-
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (53 loc) · 1.95 KB
/
python.yaml
File metadata and controls
67 lines (53 loc) · 1.95 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
name: "Python"
on:
push:
paths:
- ".github/workflows/python.yaml"
- "pyproject.toml"
- "**/*.py"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Setup Python"
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: "3.x"
allow-prereleases: true
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: "Install dependencies"
run: python -m pip install .[dev,tests]
- name: "Check formatting"
run: python -m ruff format --check .
- name: "Run ruff"
run: python -m ruff check --output-format=github .
test:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Setup Python"
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: "Install dependencies"
run: |
python -m pip install coverage pytest
python -m pip install --editable .[dev,tests]
python -m pip install --editable scratch/projects/one_two_three
- name: "Run tests"
run: python -m coverage run -m pytest --junitxml=junit.xml -o junit_family=legacy
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}