From 2421f8f2567b72f6d4c1897adc51deb22c469aa4 Mon Sep 17 00:00:00 2001 From: notgiven688 Date: Sun, 24 Nov 2024 15:22:21 +0100 Subject: [PATCH] Refine unit test workflow --- .github/workflows/jitter-tests.yml | 64 ++++++++++++++---------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/.github/workflows/jitter-tests.yml b/.github/workflows/jitter-tests.yml index 221595f8..66399320 100644 --- a/.github/workflows/jitter-tests.yml +++ b/.github/workflows/jitter-tests.yml @@ -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 @@ -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() \ No newline at end of file