Skip to content

Merge pull request #1052 from godaddy/ci-refresh-multi #30

Merge pull request #1052 from godaddy/ci-refresh-multi

Merge pull request #1052 from godaddy/ci-refresh-multi #30

name: '[C#] AppEncryption CI'
on:
workflow_dispatch:
push:
paths:
- 'csharp/AppEncryption/**'
- '.github/workflows/csharp-appencryption-*'
branches-ignore:
- 'release-*'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-csharp-ae-${{ github.ref }}
cancel-in-progress: true
env:
DYNAMODB_HOSTNAME: dynamodb
MYSQL_HOSTNAME: mysql
MYSQL_DATABASE: testdb
MYSQL_USERNAME: root
MYSQL_PASSWORD: Password123
DISABLE_TESTCONTAINERS: true
AWS_ACCESS_KEY_ID: dummykey
AWS_SECRET_ACCESS_KEY: dummy_secret
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
artifact: ${{ steps.upload-artifact.outputs.artifact_id }}
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
options: --ulimit core=-1 --ulimit memlock=-1:-1
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Add workspace to safe.directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Cache dotnet packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('csharp/**/*.csproj') }}-v2
- name: Build
run: |
cd csharp/AppEncryption
./scripts/clean.sh
./scripts/build.sh
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: csharp-app-encryption
path: |
csharp/AppEncryption/AppEncryption/bin/**
csharp/AppEncryption/AppEncryption/obj/**
csharp/AppEncryption/Crypto/bin/**
csharp/AppEncryption/Crypto/obj/**
csharp/AppEncryption/AppEncryption.Tests/bin/**
csharp/AppEncryption/AppEncryption.Tests/obj/**
csharp/AppEncryption/AppEncryption.IntegrationTests/bin/**
csharp/AppEncryption/AppEncryption.IntegrationTests/obj/**
test:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: build
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
options: --ulimit core=-1 --ulimit memlock=-1:-1
services:
dynamodb:
image: amazon/dynamodb-local
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Cache dotnet packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('csharp/**/*.csproj') }}-v2
- name: Download artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: csharp-app-encryption
path: ${{ github.workspace }}/csharp/AppEncryption
- name: Run unit tests
run: |
cd csharp/AppEncryption
./scripts/test.sh
- name: Unit test summary
uses: test-summary/action@032c8a9cec6aaa3c20228112cae6ca10a3b29336 # v2.3.0
with:
paths: 'csharp/AppEncryption/AppEncryption.Tests/test-result.xml'
if: always()