diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index b238f3ac18..3125ce04b2 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -75,9 +75,27 @@ jobs: working-directory: ./csharp run: dotnet format --verify-no-changes --verbosity diagnostic + - uses: actions/cache@v4 + id: cache-dotnet + with: + path: | + ./csharp/tests/bin + ./csharp/tests/obj + key: ${{ matrix.os }}-build-dotnet + + - name: build dotnet + working-directory: ./csharp + if: steps.cache-dotnet.outputs.cache-hit != 'true' + run: dotnet build + + - name: Remove the build result + shell: bash + if: steps.cache-dotnet.outputs.cache-hit != 'true' + run: sudo rm -r ./csharp/tests/bin | sudo rm -r ./csharp/tests/obj + - name: Test dotnet ${{ matrix.dotnet }} working-directory: ./csharp - run: dotnet test --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror + run: dotnet test --no-build --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror - uses: ./.github/workflows/test-benchmark with: