-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (81 loc) · 2.73 KB
/
pull-request.yaml
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
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.4.27"
jobs:
check:
name: Check Python (3.10)
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.10'
steps:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: install-llvm
run: "sudo apt-get update && sudo apt-get install -y llvm-14"
- name: Set up uv
uses: astral-sh/setup-uv@v4
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
- name: Check formatting with ruff
run: uv run ruff format --check guppylang
- name: Lint with ruff
run: uv run ruff check guppylang
- name: Install Guppy with llvm-based execution
run: uv sync --extra execution
- name: Cargo build validator
run: cargo build -p validator --release
- name: Run tests
run: uv run pytest
- name: Install tket2 dependencies
# This removes the `execution` extra group
run: uv sync --extra pytket
- name: Rerun `py(...)` expression tests and pytket lowering with tket2 installed
run: uv run pytest tests/integration/test_py.py tests/error/test_py_errors.py tests/integration/test_tket.py tests/integration/test_pytket_circuits.py
test-coverage:
name: Check Python (3.13) with coverage
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.13'
steps:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Guppy with execution and pytket
run: uv sync --frozen --python ${{ env.PYTHON_VERSION }} --extra execution --extra pytket
- name: Cargo build validator
run: cargo build -p validator --release
- name: Run python tests with coverage instrumentation
run: uv run pytest --cov=./ --cov-report=xml
- name: Upload python coverage to codecov.io
uses: codecov/codecov-action@v5
with:
files: coverage.xml
name: python
token: ${{ secrets.CODECOV_TOKEN }}