Skip to content

Commit 49c2698

Browse files
committed
add Python CI GH Action 2
1 parent 37b44d0 commit 49c2698

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/py-ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Python CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
python-version: [3.6, 3.7, 3.8, pypy3]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Display Python version & architecture
20+
run: |
21+
python -c "import sys; print(sys.version)"
22+
python -c "import struct; print(struct.calcsize('P') * 8)"
23+
- name: Get pip cache dir
24+
id: pip-cache
25+
run: |
26+
pip install --upgrade pip
27+
echo "::set-output name=dir::$(pip cache dir)"
28+
- name: pip cache
29+
uses: actions/cache@v2
30+
with:
31+
path: ${{ steps.pip-cache.outputs.dir }}
32+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-
35+
- name: Install Python testing dependencies
36+
run: pip install --upgrade pytest
37+
- name: Install Python project dependencies
38+
uses: py-actions/py-dependency-install@v2
39+
with:
40+
update-pip: "true"
41+
update-setuptools: "true"
42+
update-wheel: "true"
43+
- name: Install project
44+
run: pip install .
45+
- name: Python unit tests
46+
run: pytest

0 commit comments

Comments
 (0)