ci: fix dotnet test command in workflow #3
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: unit tests | |
on: [push] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Determine ReasnAPI solution filename | |
run: echo SOLUTION_FILE=$(realpath ./Server/ReasnAPI/ReasnAPI.sln) >> $GITHUB_ENV | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Install dependencies | |
run: dotnet restore ${{ env.SOLUTION_FILE }} | |
- name: Test with dotnet | |
run: dotnet test ${{ env.SOLUTION_FILE }} --logger trx --logger html --results-directory "TestResults-${{ github.sha }}" | |
- name: Upload dotnet test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dotnet-results-${{ github.sha }} | |
path: TestResults-${{ github.sha }} | |
retention-days: 14 | |
if: ${{ always() }} |