-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (76 loc) · 2.19 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CI & CD
on:
push
permissions: write-all
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install poetry
run: pipx install poetry
- name: Install dependencies
run: poetry install
- name: Check Format with black
run: |
poetry run black --check .
- name: Check import order with isort
run: |
poetry run isort -c .
- name: Lint src with pylint
run: |
poetry run poe lint-src
- name: Lint tests with pylint
run: |
poetry run poe lint-tests
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ci_index: [ 1, 2, 3, 4, 5, 6, 7, 8 ]
ci_total: [ 8 ]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Add sumo ppa
run: sudo add-apt-repository ppa:sumo/stable
- name: Update apt cache
run: sudo apt update
- name: Install sumo
run: sudo apt-get install -y sumo
- name: Docker compose up
run: docker compose -f docker-compose.yaml -f docker-compose.test.yaml up -d grafana postgresql redis
- name: Install poetry
run: pipx install poetry
- name: Install dependencies
run: poetry install
- name: Test with pytest
run: |
poetry run poe test-ci
env:
CI_INDEX: ${{ matrix.ci_index }}
CI_TOTAL: ${{ matrix.ci_total }}
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.xml
parallel: true
finish:
runs-on: ubuntu-latest
needs: test
steps:
- name: Close parallel build
uses: coverallsapp/[email protected]
with:
parallel-finished: true