-
Notifications
You must be signed in to change notification settings - Fork 250
114 lines (104 loc) · 3.29 KB
/
Copy pathrust-pipeline.yml
File metadata and controls
114 lines (104 loc) · 3.29 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
name: OpenCue Rust Build Pipeline
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
# Incremental compilation hurts CI clean builds (extra disk I/O, larger
# target dirs, no benefit since each runner is ephemeral) — turn it off.
CARGO_INCREMENTAL: 0
# Be more tolerant of registry hiccups on Windows.
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Install X11 dev libs
run: |
sudo apt-get update && sudo apt-get install -y libx11-dev protobuf-compiler libcurl4-openssl-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust-install.sh
bash ./rust-install.sh -y
- name: Cache cargo deps
uses: Swatinem/rust-cache@v2
with:
workspaces: rust
cache-on-failure: true
- name: Build
run: |
cd rust
cargo build --release --verbose
- name: Run tests
run: |
cd rust
cargo test --verbose
clippy:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install X11 dev libs
run: |
sudo apt-get update && sudo apt-get install -y libx11-dev protobuf-compiler libcurl4-openssl-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust-install.sh
bash ./rust-install.sh -y
- name: Cache cargo deps
uses: Swatinem/rust-cache@v2
with:
workspaces: rust
cache-on-failure: true
- name: Run Clippy
run: |
cd rust
cargo clippy --verbose
windows-clippy:
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install Protobuf
run: choco install protoc -y
- name: Export PROTOC path
run: echo "PROTOC=C:\ProgramData\chocolatey\bin\protoc.exe" >> $env:GITHUB_ENV
- name: Cache cargo deps
uses: Swatinem/rust-cache@v2
with:
workspaces: rust
cache-on-failure: true
- name: Run Clippy
working-directory: rust
run: cargo clippy -p rqd
windows-tests:
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Protobuf
run: choco install protoc -y
- name: Export PROTOC path
run: echo "PROTOC=C:\ProgramData\chocolatey\bin\protoc.exe" >> $env:GITHUB_ENV
- name: Cache cargo deps
uses: Swatinem/rust-cache@v2
with:
workspaces: rust
cache-on-failure: true
# Build tests first so we see compile-vs-run timing separately and the
# cache is populated even if a test later fails. `--verbose` is dropped
# — log volume noticeably slows Windows runners and the failure output
# is enough for triage.
- name: Build tests
working-directory: rust
run: cargo test -p rqd --no-run
- name: Run tests
working-directory: rust
run: cargo test -p rqd