-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.19 KB
/
Copy pathrust.yml
File metadata and controls
56 lines (47 loc) · 1.19 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
name: Rust
on:
push:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0 # Disable incremental compilation for CI (saves cache space)
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15 # Prevent runaway builds
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-dev \
libxrandr-dev \
libxi-dev \
libgl1-mesa-dev \
libasound2-dev \
pkg-config
# THIS IS THE BIG ONE - Cargo caching saves 5-10 minutes per build!
- name: Cache Cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "canopen-viewer-ci"
cache-on-failure: true
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose