-
Notifications
You must be signed in to change notification settings - Fork 4
176 lines (144 loc) · 4.38 KB
/
Copy pathci.yml
File metadata and controls
176 lines (144 loc) · 4.38 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CI/CD Pipeline
on:
push:
branches: [main, "dev/**"]
tags:
- "v*.*.*"
pull_request:
branches: [main]
release:
types: [published]
jobs:
python-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.9"
version: "0.9.2"
enable-cache: true
- name: Install dependencies
run: uv sync --locked --dev
- name: Run ruff check
run: uv run ruff check .
- name: Run ruff format check
run: uv run ruff format --check .
- name: Run mypy
run: uv run mypy src/
rust-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Check formatting
working-directory: crates
run: cargo fmt --all -- --check
- name: Build
working-directory: crates
run: cargo build --workspace --all-features
- name: Run clippy
working-directory: crates
run: cargo clippy --workspace --all-features -- -D warnings
- name: Run tests
working-directory: crates
run: cargo test --workspace --all-features
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
version: "0.9.2"
enable-cache: true
- name: Install dependencies
run: uv sync --locked --group docs
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Test build documentation
run: |
cd docs
uv run make html
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
version: "0.9.2"
enable-cache: true
- name: Install dependencies
run: uv sync --locked --dev
- name: Run tests
run: uv run pytest tests/ -n auto --cov=peakrdl_rust --cov-report=xml
- name: Report coverage
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
coverage:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Finish Coveralls
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
# Smoke-test the PyInstaller builds on every push. Artifacts are not kept.
build-binaries:
needs: [python-checks, rust-checks, test]
uses: ./.github/workflows/_build_binaries.yml
draft-release:
name: Create draft release
needs: [python-checks, rust-checks, test, build-binaries]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Download all binary artifacts
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.build-binaries.outputs.artifact-pattern }}
path: artifacts
merge-multiple: true
- name: Print checksums to summary
run: |
echo "## SHA-256 Checksums" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
cat artifacts/*.sha256 >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
# Also print to the log for easy access
echo "=== Checksums ==="
cat artifacts/*.sha256
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
generate_release_notes: true
files: artifacts/*