name: CI
on:
push:
branches:
- master
- staging
- trying
pull_request:
branches:
- "**"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
toolchain: [stable, beta, nightly]
include:
- os: macos-latest
FEATURES: metal,tiles
MACOS: true
- os: windows-latest
FEATURES: vulkan,tiles
- os: ubuntu-latest
FEATURES: vulkan,tiles
steps:
- uses: actions/checkout@v2
- name: install linux deps
run: |
sudo apt update
sudo apt install gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev libx11-dev pulseaudio
if: contains(matrix.os, 'ubuntu')
- name: install ${{ matrix.toolchain }} toolchain
id: install_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- run: rustup component add rustfmt clippy
if: contains(matrix.toolchain, 'stable')
- run: cargo fmt --all -- --check
if: contains(matrix.toolchain, 'stable')
- run: cargo clippy --features=${{matrix.FEATURES}} --workspace
if: contains(matrix.toolchain, 'stable')
- name: clean clippy-generated amethyst libs
run: rm -rf ./target/debug/deps/libamethyst*
if: contains(matrix.os, 'macos') || contains(matrix.os, 'linux')
- name: run tests
run: |
cargo test --workspace --features=${{matrix.FEATURES}}
env:
MACOS: ${{ matrix.MACOS }}
- name: install mdbook on stable macos
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
if: contains(matrix.toolchain, 'stable') && contains(matrix.os, 'macos')
- name: build mdbook on stable macos
run: mdbook build book
if: contains(matrix.toolchain, 'stable') && contains(matrix.os, 'macos')
- name: run mdbook tests on stable macos
run: mdbook test -L ./target/debug/deps book
if: contains(matrix.toolchain, 'stable') && contains(matrix.os, 'macos')