-
Notifications
You must be signed in to change notification settings - Fork 11
177 lines (150 loc) · 4.73 KB
/
ci.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: CI
on:
push:
branches:
- latest
pull_request:
branches:
- latest
jobs:
run_linters:
name: Run Linters
runs-on: ubuntu-20.04
steps:
# Fetch
- name: Fetch latest
uses: actions/checkout@v2
with:
ref: latest
- name: Fetch PR commits
uses: actions/checkout@v2
# Setup caches
- name: Setup SpacemanDMM cache
uses: actions/cache@v2
with:
path: $HOME/SpacemanDMM
key: ${{ runner.os }}-spacemandmm
- name: Setup Yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap-${{ hashFiles('./dependencies.sh', 'tools/bootstrap/node', 'tools/bootstrap/python') }}
# Dependencies & tools
- name: Install dependencies
id: deps
run: |
pip3 install setuptools
bash tools/ci/install_node.sh
bash tools/ci/install_spaceman_dmm.sh dreamchecker
tools/bootstrap/python -c ''
# Actual checks
- name: Check changelog
if: always()
run: bash tools/ci/check_changelogs.sh
- name: Check DMIs
if: always()
run: tools/bootstrap/python -m dmi.test
- name: Check tgUI linting
if: always()
run: tools/build/build --ci tgui-lint
- name: Check regex-linting
if: always()
run: tools/bootstrap/python -m ci.check_regex --log-changes-only
- name: Check HTML tags
if: always()
run: tools/bootstrap/python -m ci.tag_matcher .
- name: Check Dreamchecker
if: always()
run: ~/dreamchecker -c SpacemanDMM.toml > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
# Annotations
- name: Annotate regex-lints
if: always()
run: |
cat check_regex_output.txt
- name: Annotate Dreamchecker lints
uses: yogstation13/DreamAnnotate@v2
if: always()
with:
outputFile: output-annotations.txt
test_compile:
name: Test Compile
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Byond cache
uses: actions/cache@v2
with:
path: $HOME/BYOND
key: ${{ runner.os }}-byond
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap-${{ hashFiles('./dependencies.sh', 'tools/bootstrap/node', 'tools/bootstrap/python') }}
- name: Setup Yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Run compile
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build -Werror
maps:
name: Unit-Test
runs-on: ubuntu-20.04
strategy:
matrix:
maps: [example, tyclo-pluto, away_sites_testing]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Setup Byond cache
uses: actions/cache@v2
with:
path: $HOME/BYOND
key: ${{ runner.os }}-byond
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap-${{ hashFiles('./dependencies.sh', 'tools/bootstrap/node', 'tools/bootstrap/python') }}
- name: Setup Yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install rust-g
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
bash tools/ci/install_rust_g.sh
- name: Copy example config
run: |
cp -p config/example/* config/
- name: Run tests
env:
MAP_PATH: ${{matrix.maps}}
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --map-override=${MAP_PATH} test
- name: Log post-processing
run: |
bash tools/ci/check_log.sh data/logs/ci/diary.log