Skip to content

Commit b728dee

Browse files
author
Alex J Lennon
committed
Fix CI: Explicitly restore before running tests
Restore test project first (which restores main project as dependency), then run tests with --no-restore to use the restored dependencies. This ensures xunit is in the assets file before building.
1 parent f8b42d8 commit b728dee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
- name: Clean build artifacts
3030
run: rm -rf obj bin
3131

32+
- name: Restore dependencies
33+
run: dotnet restore tests/InstDotNet.Tests.csproj
34+
3235
- name: Run Tests
33-
run: |
34-
# Just run tests - dotnet test will build both projects as needed
35-
# The test project depends on the main project, so both get built correctly
36-
dotnet test tests/InstDotNet.Tests.csproj -c Release -p:GitCommitHash=${{ steps.git.outputs.hash }} --verbosity normal
36+
run: dotnet test tests/InstDotNet.Tests.csproj -c Release -p:GitCommitHash=${{ steps.git.outputs.hash }} --no-restore --verbosity normal
3737
continue-on-error: false
3838

3939
build:

0 commit comments

Comments
 (0)