-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.7 KB
/
workflow.python.yaml
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
---
# https://docs.github.com/en/actions/guides/building-and-testing-python
name: Python Lint
# Uncomment if you assumeZZk: Assumes python files are in ./python or pushes to main
on:
push:
branches:
- master
- main
#paths:
- 'python/**'
pull_request:
#paths:
#- 'python/**'
jobs:
python:
#runs-on: ubuntu-latest
runs-on: ubuntu-20.04
# Note with this version testing you do not need tox in the cloud
strategy:
matrix:
# 3.7 will not run with the current requirements.txt pinning
python-version: [ 3.8, 3.9 ]
steps:
# checkout repo under $GITHUB_WORKSPACE
- name: Checkout action
uses: actions/checkout@v2
with:
lfs: true
submodules: recursive
# install latest python version
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Cache pip
uses: actions/cache@v2
with:
# Ubuntu specific path
path: ~/.cache/pip
# https://github.com/actions/cache/blob/main/examples.md#python---pip
# See if there is a cache hit looking for the requirements.txt
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
# assumes python in in the subdirectory ./python
- name: Test with pytest
run: |
pip install pytest pytest-cov
cd python
pytest --cov=. --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html