Repository navigation
76 lines (70 loc) · 1.99 KB
/
Copy pathpython-package.yml
File metadata and controls
76 lines (70 loc) · 1.99 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install flake8
run: python -m pip install flake8
- name: Stop the build on syntax errors and undefined names
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Report the other findings without failing
run: flake8 . --count --exit-zero --statistics
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
env:
MPLBACKEND: Agg
TF_CPP_MIN_LOG_LEVEL: "2"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install the package and its test dependencies
run: python -m pip install -e ".[test]"
- name: Test with coverage and pytest
run: |
coverage run --source glmdisc/ -m pytest
coverage report
coverage xml
- name: Upload the coverage report
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
fail_ci_if_error: false
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build and check the distributions
run: |
python -m pip install build twine
python -m build
twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/