-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (61 loc) · 1.81 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
name: CI
on:
push:
branches: [master]
pull_request: ~
env:
FORCE_COLOR: 1
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: '1.3.2'
- name: Install pip dependencies
run: poetry install
- name: pre-commit
run: poetry run pre-commit run --all-files --show-diff-on-failure
test:
strategy:
matrix:
python-version: ['3.11', '3.10', '3.9', '3.8', '3.7']
poetry-version: ['1.3.2']
runs-on: ubuntu-20.04
env:
IS_COVERAGE_ALLOWED: ${{ secrets.CODECOV_TOKEN != '' }}
steps:
- uses: actions/checkout@master
- uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-poetry-
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install pip dependencies
run: poetry install
- name: Test
run: poetry run pytest --cov-report xml --cov=iolite_client test/
- name: Upload coverage
if: ${{ matrix.python-version == '3.11' && env.IS_COVERAGE_ALLOWED == 'true' }}
uses: codecov/codecov-action@v3
with:
files: coverage.xml