1+ name : CI
2+
3+ on :
4+ push :
5+ paths-ignore :
6+ - ' **/*.md'
7+ - ' examples*/**'
8+ branches :
9+ - master
10+ pull_request :
11+ branches :
12+ - master
13+ workflow_dispatch :
14+ schedule :
15+ - cron : ' 5 4 * * *'
16+
17+ env :
18+ basepython : 3.9
19+
20+ jobs :
21+ lint :
22+ env :
23+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
24+ name : Code linting
25+ runs-on : ubuntu-latest
26+ steps :
27+ - uses : actions/checkout@v3
28+ - name : install base python
29+ uses : actions/setup-python@v4
30+ with :
31+ python-version : ${{env.basepython}}
32+
33+ - name : Cache paths
34+ uses : actions/cache@v2
35+ with :
36+ path : |
37+ .tox
38+ ~/.virtualenvs
39+ ~/.cache/pip
40+ ~/.cache/pypoetry
41+ key : lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
42+ restore-keys : |
43+ lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
44+
45+ - name : prepare the environment
46+ run : |
47+ pip install -U setuptools pip poetry tox-docker tox-poetry
48+ poetry config virtualenvs.create false
49+ poetry install
50+ - name : lint
51+ run : tox -e linters
52+
53+ tests :
54+ runs-on : ubuntu-latest
55+ env :
56+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
57+ strategy :
58+ matrix :
59+ python-version : ['3.6', '3.7', '3.8', '3.9', '3.10']
60+ name : Test Python ${{matrix.python-version}}
61+ steps :
62+ - uses : actions/checkout@v3
63+ - name : install base python
64+ uses : actions/setup-python@v4
65+ with :
66+ python-version : ${{matrix.python-version}}
67+ - name : Cache paths
68+ uses : actions/cache@v2
69+ with :
70+ path : |
71+ .tox
72+ ~/.virtualenvs
73+ ~/.cache/pip
74+ ~/.cache/pypoetry
75+ key : cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
76+ restore-keys : |
77+ cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
78+
79+ - name : prepare the environment
80+ run : |
81+ pip install -U setuptools pip poetry tox-docker tox-poetry
82+ poetry config virtualenvs.create false
83+ poetry install
84+ - name : run tests
85+ run : tox -e cover
86+ - name : Upload coverage
87+ uses : codecov/codecov-action@v2
88+ with :
89+ fail_ci_if_error : false
90+ token : ${{ secrets.CODECOVTOKEN }}
0 commit comments