-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.01 KB
/
main.yaml
File metadata and controls
82 lines (67 loc) · 2.01 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
77
78
79
80
81
82
name: main
on:
push:
branches: [main]
pull_request:
jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Install flake8
run: pip --disable-pip-version-check install flake8
- name: Lint with flake8
run: flake8 --count
tests:
name: tests - Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.13"]
env:
VENV: .venv
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# cache option make the step fail if you don´t have requirements.txt or pyproject.toml on root.
# https://github.com/actions/setup-python/issues/807.
- name: Install UV
run: make uv
- name: Create virtual environment
run: uv venv $VENV
- name: Install package with test dependencies
run: |
. $VENV/bin/activate
make install-test
pip install .
- name: Test with pytest
run: |
. $VENV/bin/activate
make test
- name: Upload coverage reports to Codecov
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
tests-in-docker:
name: tests - Python 3.12 on Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
- name: Build docker image
run: make docker-build
- name: Run tests
run: make docker-test