This repository has been archived by the owner on Nov 16, 2024. It is now read-only.
Archived #98
This file contains 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
name: everything | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ macos-latest, ubuntu-latest, windows-latest ] | |
framework: [ 'netcoreapp3.1', 'net6.0', net7.0] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup dotnet (3.1) | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '3.1' | |
if: matrix.framework == 'netcoreapp3.1' | |
- name: Setup dotnet (6.0) | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0' | |
if: matrix.framework == 'net6.0' | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
- name: Run tests (${{ matrix.framework }}) | |
run: dotnet test --configuration Release --framework ${{ matrix.framework }} --results-directory test-results --settings test/test.runsettings | |
- name: Publish coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: test-results/*/coverage.opencover.xml | |
mutationTest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
- name: Restore Tools | |
working-directory: ./test | |
run: dotnet tool restore | |
- name: Run mutation tests | |
working-directory: ./test | |
run: dotnet stryker --reporter dashboard --with-baseline:${{ github.base_ref }} --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }} --version ${{ github.head_ref }} | |
if: github.event_name == 'pull_request' | |
- name: Run mutation tests | |
working-directory: ./test | |
run: dotnet stryker --reporter dashboard --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }} --version ${{ github.ref_name }} | |
if: github.event_name != 'pull_request' | |
sonarcloud: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
package: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
- name: Create packages (w/o version suffix) | |
run: dotnet pack --configuration Release --output pkg | |
if: startsWith(github.ref, 'refs/tags/v') == true | |
- name: Create packages (w/ version suffix) | |
run: dotnet pack --configuration Release --output pkg --version-suffix preview.${{ github.run_number }} | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
- name: Upload packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: pkg | |
if: github.event_name == 'push' | |
prerelease: | |
needs: package | |
runs-on: windows-latest | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
path: . | |
- name: Publish packages | |
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUBPACKAGES_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
if: github.ref == 'refs/heads/main' | |
release: | |
needs: package | |
runs-on: windows-latest | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
path: . | |
- name: Publish packages | |
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate --source nuget.org | |
if: startsWith(github.ref, 'refs/tags/v') == true |