Skip to content

Commit

Permalink
Refine unit test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
notgiven688 committed Nov 24, 2024
1 parent 2f188e5 commit 2421f8f
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions .github/workflows/jitter-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ permissions:
checks: write
actions: write

env:
CONFIGURATION: Release
TEST_RESULTS_DIR: ./TestResults

jobs:
build:
build-and-test:

runs-on: ubuntu-latest

Expand All @@ -21,36 +25,28 @@ jobs:
working-directory: ./src/JitterTests

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test -c Release --no-restore --test-adapter-path:. --logger "trx;LogFileName=test-results.trx"

- name: TestReport
uses: dorny/test-reporter@v1
if: always() # Run this step even if "Test" fails
with:
name: JitterTests
path: ./src/JitterTests/TestResults/test-results.trx
reporter: dotnet-trx

- name: TestDP
run: dotnet test -c Release -p:DefineConstants="USE_DOUBLE_PRECISION" --no-restore --test-adapter-path:. --logger "trx;LogFileName=test-results-dp.trx"
if: always() # Run this step even if "Test" fails

- name: TestReportDP
uses: dorny/test-reporter@v1
if: always() # Run this step even if "TestDP" fails
with:
name: JitterTestsDP
path: ./src/JitterTests/TestResults/test-results-dp.trx
reporter: dotnet-trx
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore

- name: Run Tests
run: |
mkdir -p ${{ env.TEST_RESULTS_DIR }}
# Run Single Precision Tests
dotnet test --configuration ${{ env.CONFIGURATION }} --no-restore \
--test-adapter-path:. --logger "trx;LogFileName=single-precision.trx"
# Run Double Precision Tests
dotnet test --configuration ${{ env.CONFIGURATION }} -p:DefineConstants="USE_DOUBLE_PRECISION" --no-restore \
--test-adapter-path:. --logger "trx;LogFileName=double-precision.trx"
if: always()

0 comments on commit 2421f8f

Please sign in to comment.