-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-ci.yml
More file actions
44 lines (39 loc) · 1.14 KB
/
Copy pathpython-ci.yml
File metadata and controls
44 lines (39 loc) · 1.14 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
# Example 2: Python CI
# Trigger: PR + Push, Language: Python, Includes: lint + test + cache
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a5d929201e8ee9c6e8e1ab38be8f543222189fa6 # v5.5.0
with:
python-version: '3.12'
cache: 'pip'
- run: pip install ruff
- run: ruff check .
test:
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a5d929201e8ee9c6e8e1ab38be8f543222189fa6 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: pip install -r requirements-dev.txt
- run: pytest --cov