-
Notifications
You must be signed in to change notification settings - Fork 14
169 lines (163 loc) · 4.83 KB
/
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
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
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
cancel-in-progress: true
jobs:
sqlite:
name: "SQLite & Python 3.8"
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Set up Python 3.8"
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: "Install dependencies"
run: pip install -e .[dev,csp,redis,memc]
- name: "Set up .env file"
run: cp .env.example .env
- name: "Lint project"
run: scripts/lint.sh
- name: "Run tests"
run: py.test --cov-report=xml
env:
DB_TYPE: sqlite3
- name: "Set up coveralls"
run: |-
pip install coveralls
coveralls --service=github
continue-on-error: true
env:
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: SQLite
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: "Send status to Discord"
uses: MangAdventure/discord-webhook@v0.4
if: github.event_name == 'push' && !cancelled()
continue-on-error: true
with:
run-suffix: ".1"
lang-name: Python
lang-version: "3.8"
webhook-url: ${{secrets.BUILD_WEBHOOK}}
mysql:
name: "MySQL & Python 3.9"
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10.5
ports: ["3306:3306"]
env:
MYSQL_DATABASE: mangadv
MYSQL_ROOT_PASSWORD: ${{secrets.DB_PASSWORD}}
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Set up Python 3.9"
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: "Install dependencies"
run: pip install -e .[dev,mysql]
- name: "Set up .env file"
run: cp .env.example .env
- name: "Lint project"
run: scripts/lint.sh
- name: "Run tests"
run: py.test --cov-report=xml
env:
DB_TYPE: mysql
DB_PASSWORD: ${{secrets.DB_PASSWORD}}
- name: "Set up coveralls"
run: |-
pip install coveralls
coveralls --service=github
continue-on-error: true
env:
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: MySQL
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: "Send status to Discord"
uses: MangAdventure/discord-webhook@v0.4
if: github.event_name == 'push' && !cancelled()
continue-on-error: true
with:
run-suffix: ".2"
lang-name: Python
lang-version: "3.9"
webhook-url: ${{secrets.BUILD_WEBHOOK}}
postgresql:
name: "PostgreSQL & Python 3.10"
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
ports: ["5432:5432"]
env:
POSTGRES_DB: mangadv
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${{secrets.DB_PASSWORD}}
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Set up Python 3.10"
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: "Install dependencies"
run: pip install -e .[dev,pgsql]
- name: "Set up .env file"
run: cp .env.example .env
- name: "Lint project"
run: scripts/lint.sh
- name: "Run tests"
run: py.test --cov-report=xml
env:
DB_TYPE: postgresql
DB_PASSWORD: ${{secrets.DB_PASSWORD}}
- name: "Set up coveralls"
run: |-
pip install coveralls
coveralls --service=github
continue-on-error: true
env:
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: PostgreSQL
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: "Send status to Discord"
uses: MangAdventure/discord-webhook@v0.4
if: github.event_name == 'push' && !cancelled()
continue-on-error: true
with:
run-suffix: ".3"
lang-name: Python
lang-version: "3.10"
webhook-url: ${{secrets.BUILD_WEBHOOK}}
coveralls:
name: "Coveralls"
needs: [sqlite, mysql, postgresql]
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: "Install coveralls package"
run: pip install coveralls
- name: "Upload coverage to coveralls"
run: coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}