forked from ueckoken/plarail2021-soft
-
Notifications
You must be signed in to change notification settings - Fork 1
208 lines (199 loc) · 5.64 KB
/
code-test.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: code test
on: push
jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run actionlint
shell: bash
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=
backend-auto-operation:
defaults:
run:
working-directory: ./backend/auto_operation
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: backend/auto_operation/.python-version
cache: "pip"
- name: install libraries
run: pip install -r requirements.txt -r requirements.dev.txt
- name: Run test
run: |-
make staticcheck
backend-external:
defaults:
run:
working-directory: ./backend/external
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: ./backend/external/go.mod
cache: true
cache-dependency-path: ./backend/external/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
working-directory: ./backend/external/
skip-pkg-cache: true
- name: Build Go binary
run: |-
make build
- name: Run Go Test
run: |-
make test
backend-internal:
defaults:
run:
working-directory: ./backend/internal
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: ./backend/internal/go.mod
cache: true
cache-dependency-path: ./backend/internal/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
working-directory: ./backend/internal/
skip-pkg-cache: true
- name: Build Go binary
run: |-
make build
- name: Run Go Test
run: |-
make test
backend-json2grpc:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/json2grpc
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: ./backend/json2grpc/go.mod
cache: true
cache-dependency-path: ./backend/json2grpc/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
working-directory: ./backend/json2grpc/
skip-pkg-cache: true
- name: Build Go binary
run: |-
make build
- name: Run Go Test
run: |-
make test
backend-multicaster:
defaults:
run:
working-directory: ./backend/multicaster
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: ./backend/multicaster/.python-version
cache: pip
cache-dependency-path: ./backend/multicaster/requirements-dev.txt
- run: pip install -r requirements-dev.txt
- name: Type check
run: mypy .
backend-positioning:
defaults:
run:
working-directory: ./backend/positioning
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: ./backend/positioning/go.mod
cache: true
cache-dependency-path: ./backend/positioning/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
working-directory: ./backend/positioning/
skip-pkg-cache: true
- name: Build Go binary
run: |-
make build
- name: Run Go Test
run: |-
make test
backend-speed:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/speed
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: ./backend/speed/go.mod
cache: true
cache-dependency-path: ./backend/speed/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
working-directory: ./backend/speed/
skip-pkg-cache: true
- name: Build Go binary
run: |-
make buildGoBin
- name: Run Go Test
run: |-
make test
frontend-site:
defaults:
run:
working-directory: ./frontend/site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/frontend/site/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('./frontend/site/**/yarn.lock') }}-${{ hashFiles('./frontend/site/**.[jt]s', './frontend/site/**.[jt]sx') }}
- uses: actions/setup-node@v3
with:
node-version-file: ./frontend/site/.nvmrc
cache: yarn
cache-dependency-path: ./frontend/site/yarn.lock
- name: dependency-install
run: yarn install --frozen-lockfile --immutable
- name: lint
run: yarn lint
- name: build
run: yarn build