improve coverage perf #69
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
| name: Build & Test - Ubuntu | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request_target: | |
| branches: [ "master" ] | |
| permissions: | |
| contents: read | |
| statuses: write | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.100 | |
| - name: Restore dependencies | |
| run: dotnet restore Infidex.slnx | |
| working-directory: ./src | |
| - name: Build | |
| run: dotnet build Infidex.slnx --no-restore --configuration Release -p:GeneratePackageOnBuild=false | |
| working-directory: ./src | |
| - name: Run tests | |
| run: dotnet test Infidex.slnx --no-build --configuration Release --verbosity normal | |
| working-directory: ./src | |
| - name: Update GitHub status check | |
| if: always() | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const status = '${{ job.status }}'; | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: context.payload.pull_request?.head.sha || context.sha, | |
| state: status === 'success' ? 'success' : 'failure', | |
| context: 'Build & Test (Ubuntu)', | |
| description: `The build and test ${status === 'success' ? 'passed' : 'failed'}`, | |
| target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` | |
| }); | |