-
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (96 loc) · 2.9 KB
/
run-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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# 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: Test and Run
on:
push:
branches: ["staging", "master"]
pull_request:
branches: ["staging", "master"]
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.4.0"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: |
poetry install --no-root
- name: Check syntax errors
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run unit tests
run: |
poetry run pytest -v
run-asyncio:
timeout-minutes: 2
needs: pytest
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.4.0"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Test run
run: |
poetry install --no-root
poetry run Riakmaw
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
API_ID: ${{ secrets.API_ID }}
API_HASH: ${{ secrets.API_HASH }}
DB_URI: ${{ secrets.DB_URI }}
IS_CI: "true"
run-uvloop:
timeout-minutes: 2
needs: run-asyncio
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.4.0"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Test run
run: |
poetry install --no-root -E all
poetry run Riakmaw
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
API_ID: ${{ secrets.API_ID }}
API_HASH: ${{ secrets.API_HASH }}
DB_URI: ${{ secrets.DB_URI }}
IS_CI: "true"