-
Notifications
You must be signed in to change notification settings - Fork 38
120 lines (97 loc) · 3.09 KB
/
Copy pathpull-request.yaml
File metadata and controls
120 lines (97 loc) · 3.09 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Pull Request
on:
push:
branches:
- main
pull_request:
branches:
- "**"
merge_group:
types: [checks_requested]
workflow_dispatch: {}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
UV_VERSION: "0.9.5"
jobs:
check-lockfiles:
name: Check lock files
runs-on: ubuntu-latest
env:
PYTHON_VERSION: 3.10
steps:
- uses: actions/checkout@v6
- uses: mozilla-actions/sccache-action@v0.0.10
- name: Install stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Ensure uv lockfile is up to date
run: uv lock --check
- name: Ensure cargo lockfile is up to date
run: cargo update -w --locked
check:
name: Check Python (${{ matrix.python-version }})
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v6
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.10
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Guppy
run: uv sync --frozen --python ${{ env.PYTHON_VERSION }}
- name: Type check with mypy
run: uv run mypy guppylang guppylang-internals
- name: Check formatting with ruff
run: uv run ruff format --check
- name: Lint with ruff
run: |
uv run ruff --version
uv run ruff check
- name: Run tests and export hugr test cases
run: uv run pytest -n auto --export-test-cases=guppy-exports
- name: Run integration tests on Sol platform
if: matrix.python-version == '3.12'
run: uv run pytest -n auto tests/integration --target-platform=sol -m "execution and not test_exported_hugrs"
- name: Validate exported hugr test cases
run: uv run pytest -n auto -m test_exported_hugrs
test-coverage:
name: Check Python (3.14) with coverage
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.14"
steps:
- uses: actions/checkout@v6
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.10
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Guppy
run: uv sync --frozen --python ${{ env.PYTHON_VERSION }}
- name: Run python tests with coverage instrumentation
run: uv run pytest -n auto --cov=./ --cov-report=xml
- name: Upload python coverage to codecov.io
uses: codecov/codecov-action@v7
with:
files: coverage.xml
name: python
token: ${{ secrets.CODECOV_TOKEN }}