forked from Revolutionary-Games/Thrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CIConfiguration.yml
130 lines (129 loc) · 4.31 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
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
version: 1
jobs:
build:
image: thrive/godot-ci:v25
cache:
loadFrom:
- v11-{Branch}-build
- v11-master-build
writeTo: v11-{Branch}-build
shared:
.git/lfs: v7-lfs
.import: v12-import
builds: v7-builds
native_libs: v1-native
system:
/root/.nuget: v7-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 --debug false
- run:
name: Create builds
command: dotnet run --project Scripts -- package --dehydrated
- run:
name: Upload devbuilds
command: dotnet run --project Scripts -- upload
jetbrains:
image: thrive/godot-ci:v25
cache:
loadFrom:
- v9-{Branch}-jetbrains
- v9-master-jetbrains
writeTo: v9-{Branch}-jetbrains
shared:
.git/lfs: v7-lfs
system:
/root/.nuget: v7-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
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
format_script:
image: thrive/godot-ci:v25
cache:
loadFrom:
- v9-{Branch}-format
- v9-master-format
writeTo: v9-{Branch}-format
shared:
.git/lfs: v7-lfs
system:
/root/.nuget: v7-nuget
artifacts:
paths:
- format_diff.patch
steps:
- run:
command: dotnet restore Scripts/Scripts.csproj
- run:
name: Simple Thrive code-only tests
command: dotnet test test/code_tests
- run:
name: files localization steam-build rewrite checks
command: dotnet run --project Scripts -- check files localization steam-build rewrite
- run:
when: always
name: Check format changes
command: |
git 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