-
Notifications
You must be signed in to change notification settings - Fork 115
38 lines (35 loc) · 1.03 KB
/
rust.yml
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
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-2019, ubuntu-latest]
steps:
- name: install libx11-dev
run: |
sudo apt update
sudo apt install libx11-dev libpango1.0-dev libxkbcommon-dev libxkbcommon-x11-dev
if: runner.os == 'Linux'
- uses: actions/checkout@v3
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
# rustfmt is already in the default components, but this is how platform dependencies could be used conditionally
# components: ${{ runner.os == 'Linux' && 'rustfmt' || '' }}
- name: Restore Cache
uses: Swatinem/rust-cache@v2
- name: Cargo Format
# We'll only run this on one platform.
run: cargo fmt --all -- --check
if: runner.os == 'Linux'
- name: Cargo Clippy
run: cargo clippy --workspace -- -D warnings