Skip to content

migrate to edition 2021 #211

migrate to edition 2021

migrate to edition 2021 #211

Workflow file for this run

name: Build & Test
on:
push:
branches: [ master, staging, trying ]
pull_request:
branches: [ master ]
env:
# Disable debug info ( for build speed ) and deny warnings
RUSTFLAGS: "-C debuginfo=0 -D warnings"
# Enable Cargo color
CARGO_TERM_COLOR: always
# Disable incremental builds ( because we only build once in CI )
CARGO_INCREMENTAL: 0
# Undo the dev profile overrides inside of the Cargo.toml so that the
# cargo build uses the same settings as cargo test and doesn't have
# to re-compile all deps with a different profile
CARGO_PROFILE_DEV_OPT_LEVEL: 0
CARGO_PROFILE_DEV_DEBUG: 0
# Also just disable debug symbols for testing
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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: Cargo Registry Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry
- name: Rustfmt
run: cargo fmt --all -- --check
# No need to run cargo check because clippy will check it
- name: Clippy
run: cargo clippy --workspace
build-and-test-native:
needs: check
strategy:
matrix:
os: [ 'windows-latest', 'ubuntu-latest', 'macos-latest' ]
toolchain: [ 'stable', 'nightly' ]
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- 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: Cargo Registry Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry
- name: Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: Build
run: cargo build --workspace --verbose
- name: Test
run: cargo test --workspace --verbose
build-wasm:
needs: check
runs-on: ubuntu-latest
env:
# We have overrides for the optimization levels of debug builds in
# our Cargo.toml. This sets them back to normal to improve build times.
CARGO_PROFILE_DEV_DEBUG: true
CARGO_PROFILE_DEV_OPT_LEVEL: 0
steps:
- uses: actions/checkout@v2
- name: Cargo Registry Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry
- name: Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Build
run: cargo build --workspace --verbose --target wasm32-unknown-unknown