Skip to content

Commit eff4fb9

Browse files
committed
ci in github
1 parent 9209450 commit eff4fb9

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/python-ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12]
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Cache pip
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-
35+
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip setuptools wheel poetry
39+
make setup
40+
41+
- name: Lint and run tests
42+
run: |
43+
make lint
44+
make coverage
45+
46+
coverage:
47+
if: matrix.python-version == '3.12'
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v3
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v4
56+
with:
57+
python-version: 3.9
58+
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip setuptools wheel poetry
62+
make setup
63+
64+
- name: Run coverage and upload to Coveralls
65+
env:
66+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
67+
run: |
68+
make coverage
69+
coveralls

0 commit comments

Comments
 (0)