forked from Revolutionary-Games/Thrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCIConfiguration.yml
120 lines (119 loc) · 3.83 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
version: 1
jobs:
build:
image: thrive/godot-ci:v9
cache:
loadFrom:
- v1-{Branch}-build
- v1-master-build
writeTo: v1-{Branch}-build
shared:
.git/lfs: v2-lfs
.import: v1-import
builds: v1-builds
steps:
# This is here to reimport assets, but this build would fail due to missing nuget packages
# if C# was compiled here
- run:
name: Export to make project valid
command: godot --export "Linux/X11" "builds/a.x86_64"
- run:
command: dotnet restore Thrive.sln
- run:
name: Compile with checks
command: ./check_formatting.rb -c compile
- run:
name: Create builds
command: ./make_release.rb --dehydrated
- run:
name: Upload devbuilds
command: ./upload_devbuilds.rb
jetbrains:
image: thrive/godot-ci:v9
cache:
loadFrom:
- v1-{Branch}-jetbrains
- v1-master-jetbrains
writeTo: v1-{Branch}-jetbrains
shared:
.git/lfs: v2-lfs
.import: v1-import
builds: v1-jetbrains-dummy-builds
artifacts:
paths:
- files_to_check.txt
- inspect_results.xml
- duplicate_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 Changed files:
cat files_to_check.txt
# Don't care if this fails, it's enough that the C# build works
- run:
name: Just make C# project valid; don't care if asset import fails
command: |
godot --export "Linux/X11" "builds/a.x86_64" || true
- run:
command: dotnet restore Thrive.sln
# 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
# Inspect code (this only takes like 40 seconds for all files)
- run:
command: ./check_formatting.rb -c inspectcode
- run:
command: ./check_formatting.rb -c duplicatecode
# Cleanup, this takes a *long* time when checking a lot of files
- run:
command: ./check_formatting.rb -c cleanupcode
- 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/lint:v8
cache:
loadFrom:
- v1-{Branch}-format
- v1-master-format
writeTo: v1-{Branch}-format
shared:
.git/lfs: v2-lfs
artifacts:
paths:
- files_to_check.txt
- inspect_results.xml
- duplicate_results.xml
- format_diff.patch
steps:
- run:
command: ./check_formatting.rb -c files,localization
- 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