Skip to content

Commit 24f0ab1

Browse files
authored
fix: reenable test CI job and fix mysql wrong host (#703)
1 parent ed4ae35 commit 24f0ab1

File tree

1 file changed

+66
-68
lines changed

1 file changed

+66
-68
lines changed

.github/workflows/test.yaml

Lines changed: 66 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,74 @@
1-
# TODO: fix and re-enable once resolved: https://github.com/osuAkatsuki/bancho.py/issues/631
1+
name: Test Application Code
22

3-
# name: Test Application Code
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "**.py"
9+
- "**.sh"
10+
- "**.yml"
11+
- "**.toml"
12+
- "**.lock"
13+
- "**.sql"
14+
- "Dockerfile"
15+
pull_request:
416

5-
# on:
6-
# push:
7-
# branches:
8-
# - master
9-
# paths:
10-
# - "**.py"
11-
# - "**.sh"
12-
# - "**.yml"
13-
# - "**.toml"
14-
# - "**.lock"
15-
# - "**.sql"
16-
# - "Dockerfile"
17-
# pull_request:
17+
env:
18+
APP_HOST: "0.0.0.0"
19+
APP_PORT: "10000"
20+
AUTOMATICALLY_REPORT_PROBLEMS: "False"
21+
LOG_WITH_COLORS: "False"
22+
COMMAND_PREFIX: "!"
23+
DATA_DIRECTORY: "not relevant"
24+
DB_HOST: "mysql-test"
25+
DB_NAME: "bancho"
26+
DB_PASS: "lol123"
27+
DB_PORT: "3306"
28+
DB_USER: "cmyui"
29+
DEBUG: "True"
30+
DEVELOPER_MODE: "True"
31+
DISALLOWED_NAMES: "mrekk,vaxei,btmc,cookiezi"
32+
DISALLOWED_PASSWORDS: "password,abc123"
33+
DISALLOW_OLD_CLIENTS: "False"
34+
DOMAIN: "cmyui.xyz"
35+
MENU_ICON_URL: "https://akatsuki.pw/static/logos/logo_ingame.png"
36+
MENU_ONCLICK_URL: "https://akatsuki.pw"
37+
MIRROR_DOWNLOAD_ENDPOINT: "https://catboy.best/d"
38+
MIRROR_SEARCH_ENDPOINT: "https://catboy.best/api/search"
39+
PP_CACHED_ACCS: "90,95,98,99,100"
40+
REDIRECT_OSU_URLS: "True"
41+
REDIS_DB: "0"
42+
REDIS_HOST: "redis"
43+
REDIS_PASS: "pass"
44+
REDIS_PORT: "6379"
45+
REDIS_USER: "default"
46+
SEASONAL_BGS: "https://akatsuki.pw/static/flower.png,https://i.cmyui.xyz/nrMT4V2RR3PR.jpeg"
47+
SSL_CERT_PATH: "not relevant"
48+
SSL_KEY_PATH: "not relevant"
1849

19-
# env:
20-
# APP_HOST: "0.0.0.0"
21-
# APP_PORT: "10000"
22-
# AUTOMATICALLY_REPORT_PROBLEMS: "False"
23-
# LOG_WITH_COLORS: "False"
24-
# COMMAND_PREFIX: "!"
25-
# DATA_DIRECTORY: "not relevant"
26-
# DB_HOST: "mysql"
27-
# DB_NAME: "bancho"
28-
# DB_PASS: "lol123"
29-
# DB_PORT: "3306"
30-
# DB_USER: "cmyui"
31-
# DEBUG: "True"
32-
# DEVELOPER_MODE: "True"
33-
# DISALLOWED_NAMES: "mrekk,vaxei,btmc,cookiezi"
34-
# DISALLOWED_PASSWORDS: "password,abc123"
35-
# DISALLOW_OLD_CLIENTS: "False"
36-
# DOMAIN: "cmyui.xyz"
37-
# MENU_ICON_URL: "https://akatsuki.pw/static/logos/logo_ingame.png"
38-
# MENU_ONCLICK_URL: "https://akatsuki.pw"
39-
# MIRROR_DOWNLOAD_ENDPOINT: "https://catboy.best/d"
40-
# MIRROR_SEARCH_ENDPOINT: "https://catboy.best/api/search"
41-
# PP_CACHED_ACCS: "90,95,98,99,100"
42-
# REDIRECT_OSU_URLS: "True"
43-
# REDIS_DB: "0"
44-
# REDIS_HOST: "redis"
45-
# REDIS_PASS: "pass"
46-
# REDIS_PORT: "6379"
47-
# REDIS_USER: "default"
48-
# SEASONAL_BGS: "https://akatsuki.pw/static/flower.png,https://i.cmyui.xyz/nrMT4V2RR3PR.jpeg"
49-
# SSL_CERT_PATH: "not relevant"
50-
# SSL_KEY_PATH: "not relevant"
50+
jobs:
51+
run-test-suite:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v4
5156

52-
# jobs:
53-
# run-test-suite:
54-
# runs-on: ubuntu-latest
55-
# steps:
56-
# - name: Checkout repository
57-
# uses: actions/checkout@v4
57+
- name: Build application image
58+
run: docker build -t bancho:latest .
5859

59-
# - name: Build application image
60-
# run: docker build -t bancho:latest .
60+
- name: Start containers
61+
run: docker compose -f docker-compose.test.yml up --detach --wait --wait-timeout 30 bancho-test mysql-test redis-test
6162

62-
# - name: Start containers
63-
# run: docker compose -f docker-compose.test.yml up --detach --wait --wait-timeout 30 bancho-test mysql-test redis-test
63+
- name: Run tests
64+
run: docker compose -f docker-compose.test.yml exec -T bancho-test /srv/root/scripts/run-tests.sh
6465

65-
# - name: Run tests
66-
# run: docker compose -f docker-compose.test.yml exec -T bancho-test /srv/root/scripts/run-tests.sh
66+
- name: Stop containers
67+
if: always()
68+
run: docker compose down
6769

68-
# - name: Stop containers
69-
# if: always()
70-
# run: docker compose down
71-
72-
# - name: Archive code coverage results
73-
# uses: actions/upload-artifact@v4
74-
# with:
75-
# name: code-coverage-report
76-
# path: coverage/
70+
- name: Archive code coverage results
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: code-coverage-report
74+
path: coverage/

0 commit comments

Comments
 (0)