File tree Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ jobs:
36
36
37
37
- name : Run quality checks
38
38
run : |
39
- # Check format
39
+ # Check format.
40
40
dotnet format --verify-no-changes
41
41
42
- # Run tests
43
- dotnet test --no-restore
42
+ # Purge some NuGet caches and run tests.
43
+ HARD=true ./scripts/clean-and-test.sh
44
44
45
- # Ensure pack works
45
+ # Ensure pack works.
46
46
dotnet pack --no-restore
Original file line number Diff line number Diff line change 21
21
22
22
dotnet format --verify-no-changes
23
23
24
- dotnet test --no-restore
24
+ # Purge some NuGet caches and run tests.
25
+ HARD=true ./scripts/clean-and-test.sh
25
26
26
27
dotnet pack \
27
28
--configuration Release \
Original file line number Diff line number Diff line change 1
1
# Standard Conventions for C#
2
2
3
3
Library for enforcing my preferred conventions in C#.
4
+
5
+ ## Running Tests
6
+
7
+ Test are run against packed versions of the library. Because of this, NuGet
8
+ caching can get in the way of tests seeing updates. To get around run the
9
+ following script to rebuild and run tests:
10
+
11
+ ``` bash
12
+ HARD=true ./scripts/clean-and-test.sh
13
+ ```
Original file line number Diff line number Diff line change 3
3
TEST_ARTIFACTS_PATH=" $HOME /.cache/Tdg5.StandardConventions.Tests/test-artifacts"
4
4
rm -rf " $TEST_ARTIFACTS_PATH "
5
5
find . -type d \( -name bin -o -name obj \) -print0 | xargs -0 rm -rf
6
- [ -n " $HARD " ] && dotnet nuget locals all --clear
6
+
7
+ if [ -n " $HARD " ]; then
8
+ # Try to preserve other caches to minimize restore time.
9
+ dotnet nuget locals global-packages --clear
10
+ fi
11
+
7
12
dotnet clean
8
13
9
14
dotnet test
You can’t perform that action at this time.
0 commit comments