-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
CIConfiguration.yml
68 lines (67 loc) · 2.17 KB
/
CIConfiguration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
version: 1
jobs:
test:
image: thrive/launcher:v5
cache:
loadFrom:
- v5-{Branch}-build
writeTo: v5-{Branch}-build
system:
/root/.nuget: v3-nuget
steps:
- run:
command: dotnet restore
- run:
name: Build
command: dotnet build
- run:
name: Test
command: dotnet test
lint:
image: thrive/launcher:v5
cache:
loadFrom:
- v5-{Branch}-build
writeTo: v5-{Branch}-build
system:
/root/.nuget: v3-nuget
steps:
- run:
name: Build list of changed files
# Remove the cat here once artifact uploads is done:
command: |
git diff-tree --no-commit-id --name-only -r HEAD..origin/$CI_DEFAULT_BRANCH > files_to_check.txt
git diff-tree --no-commit-id --name-only -r HEAD..$CI_EARLIER_COMMIT >> files_to_check.txt || echo compare with previous commit failed
echo Changed files:
cat files_to_check.txt
- run:
command: dotnet restore
- run:
name: Build with warnings
command: dotnet run --project Scripts -- check compile
- run:
name: File based checks
command: dotnet run --project Scripts -- check files
# Makes sure that there aren't any changes at this point to not make the CI trip up on them
- run:
name: Make sure no changes to git tracked files at this point
command: GIT_LFS_SKIP_SMUDGE=1 git reset --hard HEAD
- run:
name: Jetbrains inspectcode
command: dotnet run --project Scripts -- check inspectcode
- run:
name: Code reformatting
command: dotnet run --project Scripts -- check cleanupcode rewrite
- run:
when: always
name: Check cleanup changes
command: |
git diff > cleanup_diff.patch
if grep -q '[^[:space:]]' < cleanup_diff.patch; then
echo "Code cleanup found things to be fixed:"
cat cleanup_diff.patch
exit 1
else
echo "No changes made"
rm -f cleanup_diff.patch
fi