mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
Removing comment about macOS 11 since it's gonna be the default for macos-latest soon: https://github.com/actions/virtual-environments/issues/4060
110 lines
3.7 KiB
YAML
110 lines
3.7 KiB
YAML
name: CI
|
|
on: [push, pull_request]
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
tests:
|
|
name: Tests CI
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
rust: [stable, nightly]
|
|
# For reference: https://github.com/actions/virtual-environments#available-environments
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
profile: minimal
|
|
override: true
|
|
- name: Install linux deps
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: |
|
|
sudo apt-get update # Run update first or install might start failing eventually.
|
|
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev pkg-config xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
|
|
- run: rustc --version && cargo --version
|
|
- name: Build
|
|
# Use build instead of check since it needs to be built for tests anyway
|
|
run: cargo build --verbose --workspace --all-targets --all-features
|
|
- name: Test
|
|
# Currently --all-targets *disables* running doc-tests
|
|
# and none of the other targets such as examples *currently* have tests
|
|
# so we don't use it. It should be added later when the issue is fixed:
|
|
# https://github.com/rust-lang/cargo/issues/6669
|
|
run: cargo test --verbose --workspace --all-features
|
|
|
|
wasm:
|
|
name: Wasm CI
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
rust: [stable, nightly]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
profile: minimal
|
|
override: true
|
|
- name: Install Dependencies
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
- run: rustc --version && cargo --version && wasm-pack --version
|
|
- name: Build
|
|
run: |
|
|
cd examples/wasm
|
|
wasm-pack build --target web
|
|
- name: Test
|
|
run: |
|
|
cd examples/wasm
|
|
wasm-pack test --headless --chrome
|
|
wasm-pack test --headless --firefox
|
|
|
|
format:
|
|
name: Rustfmt CI
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: rustup update
|
|
- run: cargo fmt --version
|
|
- run: cargo fmt -- --check
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly # Check on nightly because it sometimes has more lints.
|
|
profile: minimal
|
|
override: true
|
|
- name: Update
|
|
run: sudo apt update
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo apt-get update # Run update first or install might start failing eventually
|
|
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev pkg-config xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
|
|
- run: cargo clippy --version
|
|
# Using --all-targets to also check tests and examples.
|
|
# Note that technically --all-features doesn't check all code when something is *disabled* by a feature.
|
|
- run: cargo clippy --workspace --all-targets --all-features -- --deny warnings
|
|
|
|
docs:
|
|
name: Documentation CI
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly # docs.rs uses nightly: https://docs.rs/about/builds
|
|
profile: minimal
|
|
override: true
|
|
- run: rustc --version && cargo --version
|
|
- name: Build Docs
|
|
run: cargo doc --all-features
|
|
env:
|
|
RUSTDOCFLAGS: --deny warnings
|