From f8c5ce5a6e65b900b50feb9421ddf5746110935b Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Wed, 26 Aug 2020 14:57:35 -0400 Subject: [PATCH] Separate CI jobs (#357) --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71dabb4553391..de105190088ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,24 +15,73 @@ env: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + toolchain: [stable, nightly] steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ matrix.toolchain }} override: true - - uses: actions-rs/toolchain@v1 + - uses: actions/cache@v2 with: - toolchain: nightly - components: rustfmt, clippy + path: | + target + key: ${{ runner.os }}-cargo-check-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} - name: Install alsa - run: sudo apt-get install libasound2-dev + run: sudo apt-get install --no-install-recommends libasound2-dev - name: Build run: cargo check + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-C debuginfo=0 -D warnings" + + test: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: [stable, nightly] + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - uses: actions/cache@v2 + with: + path: | + target + key: ${{ runner.os }}-cargo-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} + + - name: Install alsa + run: sudo apt-get install --no-install-recommends libasound2-dev + + - name: Run tests + run: cargo test --workspace + 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 - name: Check the format run: cargo +nightly fmt --all -- --check @@ -46,6 +95,3 @@ jobs: -- -D warnings -A clippy::type_complexity - - - name: Run tests - run: cargo test --workspace