-
Notifications
You must be signed in to change notification settings - Fork 11
76 lines (73 loc) · 2.7 KB
/
gci-tests.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
name: gci-tests
on:
workflow_dispatch:
push:
branches: [master]
pull_request:
paths-ignore:
- "images/**"
- "sql/analytics/**"
- "**.md"
- "docs/**"
pull_request_target:
types: [labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{!github.event.issue.pull_request_target || contains(github.event.pull_request.labels.*.name, 'safe to test')}}
env:
DB_PASS_CI: kmq_ci_password
DB_USER_CI: root
DB_PORT: 3306
steps:
- name: Checkout KMQ_Discord
uses: actions/checkout@v4
- name: Check for undocumented game option commands
run: src/ci_checks/check_help.sh
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup MariaDB
uses: getong/[email protected]
with:
mariadb version: "10.6.17"
mysql root password: "$DB_PASS_CI"
- name: Check for newly introduced environment variables
run: python src/ci_checks/check_env_var.py
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install protobuf compiler
run: sudo apt install -y protobuf-compiler
- name: Install node dependencies
run: yarn install --frozen-lockfile
- name: Prettier
run: npm run prettier-ci
- name: npm run lint
run: npm run lint-ci
- name: Lint translations
run: npm run lint-i18n-ci
- name: Check for missing translations
run: npx ts-node src/ci_checks/missing_i18n.ts $(find src -name '*.ts' -print)
- name: Copy .env for CI
run: |
echo "DB_USER=$DB_USER_CI" >> .env
echo "DB_PASS=$DB_PASS_CI" >> .env
echo "DB_HOST=127.0.0.1" >> .env
echo "DB_PORT=$DB_PORT" >> .env
echo "DB_PORT=3306" >> .env
echo "BOT_CLIENT_ID=123" >> .env
shell: bash
- name: Wait for MySQL server to start
run: |
while ! mysqladmin ping --host=127.0.0.1 --password="$DB_PASS_CI" --silent; do
sleep 1
done
- name: Run tests
run: npm run test-ci