Merge pull request #66 from AshleighAdams/bugfix #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WARNING: This file is automatically generated by ../regenerate-actions.sh | |
| name: CD | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - support/* | |
| paths-ignore: | |
| - docs/** | |
| - README.md | |
| - .editorconfig | |
| - .gitattributes | |
| - .gitignore | |
| - .github/ISSUE_TEMPLATE/** | |
| - .github/pull_request_template.md | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Setup .NET 6 | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Setup Verlite | |
| run: | | |
| verlite_version="$(grep '"Verlite\.MsBuild"' Directory.Build.props | LC_ALL=en_US.utf8 grep -Po 'Version="\K[^"]+')" | |
| dotnet tool install --global Verlite.CLI --version "$verlite_version" | |
| verlite . --auto-fetch --verbosity verbatim | |
| - name: Install OpenSSL 1.1 | |
| if: runner.os == 'Linux' | |
| run: | | |
| wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb | |
| sudo apt-get install ./libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb -f | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test --configuration Debug --logger GitHubActions -p:CollectCoverage=true | |
| -p:CoverletOutputFormat=cobertura | |
| - name: Pack | |
| run: dotnet pack -p:PackageOutputPath="$(pwd)/artifacts" --configuration Release | |
| --no-restore | |
| - name: Publish Codecov | |
| uses: codecov/codecov-action@v2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./tests/UnitTests/coverage.cobertura.xml | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: success() || failure() | |
| with: | |
| name: artifacts | |
| if-no-files-found: error | |
| path: | | |
| artifacts/* | |
| mutation-tests: | |
| name: Mutation Test | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Setup .NET 6 | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Setup Verlite | |
| run: | | |
| verlite_version="$(grep '"Verlite\.MsBuild"' Directory.Build.props | LC_ALL=en_US.utf8 grep -Po 'Version="\K[^"]+')" | |
| dotnet tool install --global Verlite.CLI --version "$verlite_version" | |
| verlite . --auto-fetch --verbosity verbatim | |
| - name: Install OpenSSL 1.1 | |
| if: runner.os == 'Linux' | |
| run: | | |
| wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb | |
| sudo apt-get install ./libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb -f | |
| - name: Mutation Test | |
| run: | | |
| dotnet tool install --global dotnet-stryker --version 3.2.0 | |
| cd tests/UnitTests | |
| if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then | |
| dotnet stryker --reporter html --reporter dashboard --reporter progress --version master # --log-to-file | |
| else | |
| dotnet stryker --reporter html --reporter progress # --log-to-file | |
| fi | |
| env: | |
| STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} | |
| - name: Archive mutation output | |
| if: success() || failure() | |
| run: | | |
| cd tests/UnitTests | |
| mkdir -p ../../artifacts | |
| find StrykerOutput -name mutation-report.html -exec cp {} ../../artifacts/ \; | |
| if [[ -d StrykerOutput ]]; then | |
| mv StrykerOutput ../../artifacts/StrykerOutput | |
| fi | |
| - name: Upload mutation test artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: success() || failure() | |
| with: | |
| name: artifacts-mutation-test | |
| if-no-files-found: error | |
| path: | | |
| artifacts/* | |
| publish: | |
| name: Publish | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Setup .NET 6 | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Install OpenSSL 1.1 | |
| if: runner.os == 'Linux' | |
| run: | | |
| wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb | |
| sudo apt-get install ./libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb -f | |
| - name: Setup NuGet | |
| run: | | |
| dotnet nuget update source github --store-password-in-clear-text --username AshleighAdams --password ${{ secrets.GITHUB_TOKEN }} | |
| dotnet nuget enable source github | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: '*' | |
| merge-multiple: true | |
| - name: Publish Nuget GitHub | |
| run: dotnet nuget push 'artifacts/*.nupkg' -k ${GITHUB_TOKEN} -s github --skip-duplicate | |
| --no-symbols | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |