* Simplify syntax & lint. Combine apt installations into a single step.  Future-proof OS selections.

* Remove caching

* Run clippy within the linux stable build. Parallelize all the builds. Cargo check is unneeded.

* build and run tests on windows and macos
This commit is contained in:
Nathan Stocks 2021-01-26 18:11:38 -07:00 committed by GitHub
parent 940bcf9b0f
commit 3529dd6fdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 64 deletions

View File

@ -14,45 +14,38 @@ jobs:
strategy:
matrix:
toolchain: [stable, nightly]
os: [windows-2019, ubuntu-20.04, macos-10.15]
os: [windows-latest, ubuntu-latest, macos-latest]
exclude:
- os: macos-10.15
- os: macos-latest
toolchain: nightly
- os: windows-2019
- os: windows-latest
toolchain: nightly
runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
override: true
- uses: actions/cache@v2
with:
path: |
target
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
if: runner.os == 'linux'
- name: Install alsa
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev
if: ${{ runner.os == 'Linux' }}
- name: Check the format
run: cargo fmt --all -- --check
if: runner.os == 'linux' && matrix.toolchain == 'stable'
- name: Install udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev
if: ${{ runner.os == 'Linux' }}
# type complexity must be ignored because we use huge templates for queries
# -A clippy::manual-strip: strip_prefix support was added in 1.45. we want to support earlier rust versions
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::type_complexity -A clippy::manual-strip
if: runner.os == 'linux' && matrix.toolchain == 'stable'
- name: Build
run: cargo check
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Run tests
- name: Build & run tests
run: cargo test --workspace
if: ${{ runner.os == 'Linux' }}
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
@ -61,9 +54,8 @@ jobs:
strategy:
matrix:
toolchain: [stable, nightly]
os: [ubuntu-20.04]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v2
@ -73,12 +65,6 @@ jobs:
target: wasm32-unknown-unknown
override: true
- uses: actions/cache@v2
with:
path: |
target
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check wasm
uses: actions-rs/cargo@v1
with:
@ -86,37 +72,12 @@ jobs:
args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi
- name: Install Cargo APK
run: cargo install cargo-apk
- name: Build APK
run: cargo apk build --example android
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2020-12-07
components: rustfmt, clippy
override: true
- name: Install alsa
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev
- name: Install udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev
- name: Check the format
run: cargo +nightly-2020-12-07 fmt --all -- --check
# type complexity must be ignored because we use huge templates for queries
# -A clippy::manual-strip: strip_prefix support was added in 1.45. we want to support earlier rust versions
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::type_complexity -A clippy::manual-strip
- name: Install Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi
- name: Install Cargo APK
run: cargo install cargo-apk
- name: Build APK
run: cargo apk build --example android

View File

@ -2,14 +2,14 @@ name: iOS cron CI
on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: macOS-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2