Repository navigation
Expand file tree
/
Copy pathCIConfiguration.yml
More file actions
149 lines (147 loc) · 5.27 KB
/
Copy pathCIConfiguration.yml
File metadata and controls
149 lines (147 loc) · 5.27 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: 1
jobs:
build:
image: thrive/godot-ci:v30
cache:
loadFrom:
- v14-{Branch}-build
- v14-master-build
writeTo: v14-{Branch}-build
shared:
.git/lfs: v8-lfs
.import: v14-import
builds: v7-builds
native_libs: v2-native
system:
/root/.nuget: v8-nuget
steps:
# Doesn't seem required for Godot 4
# - run:
# name: Make project valid for compile
# command: dotnet run --project Scripts -- make-project-valid
- run:
command: dotnet restore Thrive.sln
- run:
name: Build with warnings
command: dotnet run --project Scripts -- check compile
- run:
name: Download native libraries
# This doesn't fetch or install debug variants as they aren't strictly necessary for packaging
command: dotnet run --project Scripts -- native Fetch Install --debug false
- run:
name: Create builds (Linux, Windows)
command: dotnet run --project Scripts -- package --dehydrated Linux Windows
- run:
name: Upload devbuilds
command: dotnet run --project Scripts -- upload
jetbrains:
image: thrive/godot-ci:v30
cache:
loadFrom:
- v9-{Branch}-jetbrains
- v9-master-jetbrains
writeTo: v9-{Branch}-jetbrains
shared:
.git/lfs: v8-lfs
system:
/root/.nuget: v8-nuget
artifacts:
paths:
- files_to_check.txt
- inspect_results.xml
- cleanup_diff.patch
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:
name: Make sure Thrive is compiled
command: dotnet build Thrive.sln
- run:
command: dotnet tool restore
# 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
# dupfinder is deprecated, see: https://github.com/Revolutionary-Games/Thrive/issues/2953
# - run:
# command: ./check_formatting.rb -c duplicatecode
# Cleanup, this takes a *long* time when checking a lot of files
- run:
when: always
name: Check cleanup changes
# Mode changes are ignored as that can cause spurious failures due to hardlink-based caching
command: |
git -c core.fileMode=false 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
format_test:
image: thrive/godot-ci:v30
cache:
loadFrom:
- v10-{Branch}-format
- v10-master-format
writeTo: v10-{Branch}-format
shared:
.git/lfs: v8-lfs
native_libs: v2-native
system:
/root/.nuget: v8-nuget
artifacts:
paths:
- format_diff.patch
steps:
- run:
command: dotnet restore Scripts/Scripts.csproj
- 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: files localization steam-build rewrite checks
command: dotnet run --project Scripts -- check files localization steam-build rewrite
- run:
name: Make sure no lib files were modified
command: GIT_LFS_SKIP_SMUDGE=1 git checkout HEAD -- native_libs/
- run:
when: always
name: Check format changes
# Mode changes are ignored as that can cause spurious failures due to hardlink-based caching
command: |
git -c core.fileMode=false diff > format_diff.patch
if grep -q '[^[:space:]]' < format_diff.patch; then
echo "Formatter found things to be fixed:"
cat format_diff.patch
exit 1
else
echo "No changes made"
rm -f format_diff.patch
fi
- run:
name: Build all projects
command: dotnet build Thrive.sln
- run:
name: Download native libraries
command: dotnet run --project Scripts -- native Fetch Install --debug true
- run:
name: Make sure Godot resources are imported for test detection
command: godot --editor --headless --quit-after 200 .
- run:
name: Unit tests
command: dotnet run --project Scripts -- test