-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (83 loc) · 2.23 KB
/
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
# Run unit tests
name: Test
on:
push:
branches:
- master
- develop
pull_request:
jobs:
# Static Analysis
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: pip install isort
- run: isort . --check --diff
# Tests
unit-test:
runs-on: ubuntu-latest
services:
faf-db:
image: mariadb:10.6
ports:
- 3306:3306
options: >-
--name faf-db
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MYSQL_ROOT_PASSWORD: banana
MYSQL_DATABASE: faf-league
MYSQL_USER: faf-league-service
MYSQL_PASSWORD: banana
faf-rabbitmq:
image: rabbitmq:3.8-management-alpine
ports:
- 5672:5672
options: >-
--name faf-rabbitmq
--health-cmd "rabbitmq-diagnostics check_running --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RABBITMQ_PID_FILE: /var/lib/rabbitmq/pid
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: banana
RABBITMQ_DEFAULT_VHOST: /
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup RabbitMQ
run: ./.github/workflows/scripts/init-rabbitmq.sh
- name: Install dependencies
run: |
pip install pipenv
pipenv sync --dev
- name: Setup db
run: pipenv run migrate-develop
- name: Run tests with pipenv
run: pipenv run tests --cov-report=xml
- name: Report coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.COVERALLS_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: docker build -t test_image .