-
Notifications
You must be signed in to change notification settings - Fork 11
46 lines (37 loc) · 1.17 KB
/
python-package.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
---
name: Python package
'on':
pull_request:
branches: ["master"]
push:
branches: ["master"] # cache from master shared with child branches
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Install python
uses: actions/setup-python@v4
id: pinstall
with:
python-version-file: pyproject.toml
cache: pip
cache-dependency-path: |
poetry.lock
- name: Install poetry
run: |
python -m pip install poetry
- name: Install package
run: |
poetry install
- name: Test with pytest
run: |
python -m poetry run pytest
# true if cache-hit occured on the primary key
- run: echo '${{ steps.pinstall.outputs.cache-hit }}'
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings
# flake8 . --count --exit-zero --max-complexity=10 --statistics