CI Tuning (#1318)
* 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:
parent
940bcf9b0f
commit
3529dd6fdf
73
.github/workflows/ci.yml
vendored
73
.github/workflows/ci.yml
vendored
@ -14,45 +14,38 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain: [stable, nightly]
|
toolchain: [stable, nightly]
|
||||||
os: [windows-2019, ubuntu-20.04, macos-10.15]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
exclude:
|
exclude:
|
||||||
- os: macos-10.15
|
- os: macos-latest
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
- os: windows-2019
|
- os: windows-latest
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: clean
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
|
components: rustfmt, clippy
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- name: Install alsa and udev
|
||||||
with:
|
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
|
||||||
path: |
|
if: runner.os == 'linux'
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Install alsa
|
- name: Check the format
|
||||||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev
|
run: cargo fmt --all -- --check
|
||||||
if: ${{ runner.os == 'Linux' }}
|
if: runner.os == 'linux' && matrix.toolchain == 'stable'
|
||||||
|
|
||||||
- name: Install udev
|
# type complexity must be ignored because we use huge templates for queries
|
||||||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev
|
# -A clippy::manual-strip: strip_prefix support was added in 1.45. we want to support earlier rust versions
|
||||||
if: ${{ runner.os == 'Linux' }}
|
- 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
|
- name: Build & run tests
|
||||||
run: cargo check
|
|
||||||
env:
|
|
||||||
CARGO_INCREMENTAL: 0
|
|
||||||
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: cargo test --workspace
|
run: cargo test --workspace
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
||||||
@ -61,9 +54,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain: [stable, nightly]
|
toolchain: [stable, nightly]
|
||||||
os: [ubuntu-20.04]
|
os: [ubuntu-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: clean
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -73,12 +65,6 @@ jobs:
|
|||||||
target: wasm32-unknown-unknown
|
target: wasm32-unknown-unknown
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Check wasm
|
- name: Check wasm
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
@ -95,28 +81,3 @@ jobs:
|
|||||||
run: cargo install cargo-apk
|
run: cargo install cargo-apk
|
||||||
- name: Build APK
|
- name: Build APK
|
||||||
run: cargo apk build --example android
|
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
|
|
||||||
|
4
.github/workflows/ios.yml
vendored
4
.github/workflows/ios.yml
vendored
@ -2,14 +2,14 @@ name: iOS cron CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *'
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macOS-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user