bevy/.github/workflows/ci.yml

87 lines
2.1 KiB
YAML
Raw Normal View History

name: CI
2020-05-29 03:48:18 +00:00
on:
2020-08-26 18:57:55 +00:00
push:
branches: [master]
2020-05-29 03:48:18 +00:00
pull_request:
2020-05-29 05:44:04 +00:00
branches: [master]
2020-05-29 03:48:18 +00:00
env:
CARGO_TERM_COLOR: always
jobs:
build:
2020-08-26 18:57:35 +00:00
strategy:
matrix:
toolchain: [stable, nightly]
os: [windows-2019, ubuntu-20.04, macos-10.15]
2020-09-03 01:10:42 +00:00
exclude:
- os: macos-10.15
toolchain: nightly
runs-on: ${{ matrix.os }}
2020-09-03 01:10:42 +00:00
needs: clean
2020-05-29 03:48:18 +00:00
steps:
2020-05-29 05:44:04 +00:00
- uses: actions/checkout@v2
2020-08-16 03:27:41 +00:00
2020-06-08 08:05:56 +00:00
- uses: actions-rs/toolchain@v1
with:
2020-08-26 18:57:35 +00:00
toolchain: ${{ matrix.toolchain }}
2020-06-08 08:05:56 +00:00
override: true
2020-08-16 03:27:41 +00:00
2020-08-26 18:57:35 +00:00
- uses: actions/cache@v2
2020-08-16 03:27:41 +00:00
with:
2020-08-26 18:57:35 +00:00
path: |
target
2020-09-03 01:10:42 +00:00
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
2020-08-16 03:27:41 +00:00
2020-07-23 20:18:23 +00:00
- name: Install alsa
2020-09-03 01:10:42 +00:00
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev
if: ${{ runner.os == 'Linux' }}
2020-08-16 03:27:41 +00:00
- name: Install udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev
if: ${{ runner.os == 'Linux' }}
2020-05-29 05:44:04 +00:00
- name: Build
2020-06-08 08:05:56 +00:00
run: cargo check
2020-08-26 18:57:35 +00:00
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Run tests
run: cargo test --workspace
2020-09-03 01:10:42 +00:00
if: ${{ runner.os == 'Linux' }}
2020-08-26 18:57:35 +00:00
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
override: true
- name: Install alsa
run: sudo apt-get install --no-install-recommends libasound2-dev
2020-08-16 03:27:41 +00:00
- name: Install udev
run: sudo apt-get install --no-install-recommends libudev-dev
2020-08-16 03:27:41 +00:00
- name: Check the format
run: cargo +nightly fmt --all -- --check
# type complexity must be ignored because we use huge templates for queries
- name: Run clippy
run: >
cargo +nightly clippy
--all-targets
--all-features
--
-D warnings
-A clippy::type_complexity