Add a CI check that everything compiles (#321)

This commit is contained in:
Daniel McNab 2023-05-18 16:14:46 +01:00 committed by GitHub
parent ef2630ad9c
commit 2c394aa265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,6 @@ on:
push: push:
branches: branches:
- main - main
- dev
pull_request: pull_request:
jobs: jobs:
@ -11,17 +10,35 @@ jobs:
name: cargo fmt name: cargo fmt
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --all --check
compiles:
runs-on: ubuntu-latest
name: Check workspace compile
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- name: Install native dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- run: cargo check --workspace
# --exclude with_bevy # for when bevy has an outdated wgpu version
# -Dwarnings # for when we have fixed unused code warnings
- name: install stable toolchain wasm:
uses: actions-rs/toolchain@v1 runs-on: ubuntu-latest
name: Ensure with_winit compiles on WASM
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable targets: wasm32-unknown-unknown
profile: minimal # cargo-run-wasm does not provide a way to determine that it failed programmatically.
components: rustfmt # Ideally, fix this and use:
override: true # - run: cargo run_wasm -- -p with_winit --bin with_winit_bin --build-only
- name: Allow using WebGPU in web_sys
run: |
echo "RUSTFLAGS=--cfg=web_sys_unstable_apis" >> "$GITHUB_ENV"
- run: cargo check -p with_winit --target wasm32-unknown-unknown
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check