2020-05-26 08:23:47 +10:00
|
|
|
name: Rust
|
|
|
|
|
2020-09-06 08:45:49 +10:00
|
|
|
on: [push, pull_request]
|
2024-03-30 10:55:44 +11:00
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2020-05-26 08:23:47 +10:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
2024-03-30 10:55:44 +11:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: -D warnings
|
|
|
|
RUSTDOCFLAGS: -D warnings
|
2020-05-26 08:23:47 +10:00
|
|
|
steps:
|
2024-03-30 10:55:44 +11:00
|
|
|
- uses: actions/checkout@v4
|
2020-06-01 04:29:32 +10:00
|
|
|
- name: Install XCB and GL dependencies
|
2020-05-26 08:44:15 +10:00
|
|
|
if: contains(matrix.os, 'ubuntu')
|
2024-03-30 16:29:18 +11:00
|
|
|
run: sudo apt-get install libx11-dev libxcb1-dev libx11-xcb-dev libgl1-mesa-dev
|
2020-06-01 04:29:32 +10:00
|
|
|
- name: Install rust stable
|
2024-03-30 10:55:44 +11:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2020-05-26 08:23:47 +10:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
2024-03-30 10:55:44 +11:00
|
|
|
components: rustfmt, clippy
|
|
|
|
- name: Build Default
|
|
|
|
run: cargo build --workspace --all-targets --verbose
|
|
|
|
- name: Build All Features
|
|
|
|
run: cargo build --workspace --all-targets --all-features --verbose
|
2020-05-26 08:23:47 +10:00
|
|
|
- name: Run tests
|
2024-03-30 10:55:44 +11:00
|
|
|
run: cargo test --workspace --all-targets --all-features --verbose
|
|
|
|
- name: Check docs
|
|
|
|
run: cargo doc --examples --all-features --no-deps
|
|
|
|
- name: Clippy
|
|
|
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
|
|
- name: Check Formatting (rustfmt)
|
|
|
|
run: cargo fmt --all -- --check
|