Skip to content

Commit fa13240

Browse files
committed
ci(actions): add presubmit test matrix and format check workflow
Change-Id: I23c2f36863fe1cb5f7c0a3a00f2f0af34cb84995
1 parent ba473bd commit fa13240

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/presubmit.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Runs tests and formatting checks on pull requests targeted to main
2+
permissions: read-all
3+
name: Presubmit
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint:
11+
name: Code Format Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
15+
with:
16+
persist-credentials: false
17+
- name: Set up Python
18+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
19+
with:
20+
python-version: "3.12"
21+
cache: 'pip'
22+
- name: Install dependencies
23+
run: pip install -e .[dev]
24+
- name: Check formatting
25+
run: nox -s format
26+
27+
test:
28+
name: Test (Python ${{ matrix.python-version }})
29+
needs: lint
30+
strategy:
31+
matrix:
32+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
36+
with:
37+
persist-credentials: false
38+
- name: Set up Python
39+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
allow-prereleases: true
43+
cache: 'pip'
44+
- name: Install dependencies
45+
run: pip install -e .[dev]
46+
- name: Run tests
47+
run: nox -s tests-${{ matrix.python-version }}

0 commit comments

Comments
 (0)