forked from novitalabs/pegaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (150 loc) · 4.27 KB
/
ci.yml
File metadata and controls
168 lines (150 loc) · 4.27 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
name: "CI"
on:
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
RUST_TOOLCHAIN_NIGHTLY: nightly-2025-02-20
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
jobs:
typos-check:
name: typos check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Run typos check
uses: crate-ci/typos@master
rust-fmt-check:
name: rust fmt check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Run rust format check
run: |
cargo fmt --all -- --check
rust-clippy-check:
name: rust clippy check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Run rust clippy check (core)
run: |
cargo clippy -p pegaflow-core --all-targets -- -D warnings
- name: Run rust clippy check (server)
run: |
cargo clippy -p pegaflow-server --all-targets -- -D warnings
# Skip python package clippy for now (requires CUDA)
ruff-check:
name: ruff check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Run ruff check
uses: astral-sh/ruff-action@v3
cargo-check:
name: cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Run cargo check (core)
run: |
cargo check -p pegaflow-core
- name: Run cargo check (server)
run: |
cargo check -p pegaflow-server
build-wheel:
name: build Python wheel
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
- name: Install CUDA Toolkit
uses: Jimver/cuda-toolkit@v0.2.24
with:
cuda: '12.8.1'
linux-local-args: '["--toolkit"]'
method: 'network'
sub-packages: '["nvcc", "nvrtc-dev", "cudart-dev"]'
- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Install maturin
run: pip install maturin
- name: Build wheel
run: |
./scripts/build-wheel.sh --release
env:
CUDA_PATH: /usr/local/cuda
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: pegaflow-wheel-ci
path: target/wheels/*.whl
retention-days: 1