-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (71 loc) · 2.21 KB
/
main.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
# This GitHub Actions workflow contains two jobs:
# -- First, Lint uses the latest Ubuntu image and Python 3.9 to check
# the code and writing for defects, using the Poetry lint task
#
# -- Second, Test uses a strategy matrix to test the code with different
# Python versions and determine code coverage, using the Poetry test task
name: Lint and Test
on: [push, pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
id: setup-python
with:
python-version: 3.9
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.12
- name: Setup Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry env info
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
- name: Lint code
run: poetry run task lint
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@v4
- name: Check spelling
uses: zwaldowski/cspell-action@v1
with:
paths: "*.md"
config: .github/cspell.json
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.12
- name: Setup Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry env info
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
- name: Execute tests
run: poetry run task test