-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (90 loc) · 2.67 KB
/
pre_merge.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
name: pre-merge
run-name: ${{ github.actor }} pre-merge
on: [pull_request]
jobs:
rust_checks:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container: rust:latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build Rust package
run: cargo build --workspace
- name: Rust tests
run: cargo test
- name: Rust example
run: cargo run --example basic_sim 200 100
- name: Rust formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -Dwarnings
maturin_build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install hatch 🐣
run: pip install hatch
- name: Python pre-commit checks ✅
run: hatch run dev:lint
- name: Maturin build
run: hatch run dev:build
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: python_build
path: target/wheels/verbs-*.whl
python_tests:
needs: maturin_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: python_build
- name: Install package
run: pip install verbs-*-manylinux_2_34_x86_64.whl
- name: Install pytest
run: pip install pytest
- name: Run tests 🧪
run: pytest -v tests
python_examples:
needs: maturin_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: python_build
- name: Install package
run: pip install verbs-*-manylinux_2_34_x86_64.whl
- name: Run basic example
run: python examples/basic_sim.py
- name: Run batch runner example
run: python examples/batch_runner.py
python_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install hatch 🐣
run: pip install hatch
- name: Install verbs and build docs 📚
run: hatch run sphinx:build