-
Notifications
You must be signed in to change notification settings - Fork 17
99 lines (96 loc) · 2.82 KB
/
build-core.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
name: Build core (Python / Django)
on:
push:
branches:
- master
pull_request:
paths:
- "**/*.py"
- "templates/**/*.html"
- ".github/workflows/build-core.yml"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: "3.11.5"
cache: "poetry"
- name: apt-get
run: |
sudo apt-get update
sudo apt-get install libldap2-dev libsasl2-dev libxmlsec1-dev libmysqlclient-dev pkg-config
- name: poetry install
run: |
poetry install --no-ansi
- name: staticchecks
run: |
poetry run tox
env:
TOXENV: "staticchecks"
python311:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3.8.19-management
ports:
- 5672:5672
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6
ports:
- 9200:9200
env:
discovery.type: single-node
ES_JAVA_OPTS: -Xms512m -Xmx512m
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
mysql:
image: mysql:5.7
ports:
- 3306:3306
env:
MYSQL_USER: airone
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: airone
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: "3.11.5"
cache: "poetry"
- name: Install additional dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libxmlsec1-dev default-mysql-client default-libmysqlclient-dev
- name: Prepare MySQL
run: |
mysql -protocol=tcp -uroot -h127.0.0.1 -ppassword -e "SET GLOBAL character_set_server=utf8; SET GLOBAL collation_server=utf8_general_ci; SET GLOBAL default_storage_engine=InnoDB;"
mysql -protocol=tcp -uroot -h127.0.0.1 -ppassword -e "GRANT ALL ON *.* to airone@'%' IDENTIFIED BY 'password'"
- name: poetry install
run: |
poetry install --no-ansi
- name: test
run: |
poetry run tox
env:
TOXENV: "py311"
- name: coverage
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: core
continue-on-error: true