-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (36 loc) · 1.03 KB
/
rust.yml
File metadata and controls
40 lines (36 loc) · 1.03 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
name: Rust
on:
pull_request:
branches:
- "**"
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
run: rustup component add rustfmt clippy llvm-tools-preview
- name: Install graphics dependencies for headless testing
run: |
sudo apt-get update
sudo apt-get install -y xvfb libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev mesa-vulkan-drivers
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Build
run: cargo build
- name: Run tests with coverage
run: xvfb-run -a cargo llvm-cov --lcov --output-path lcov.info || true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: false
- name: clippy
run: cargo clippy --no-deps -- -D warnings
- name: fmt
run: cargo fmt --check