From ec6363813c0abf2e41b7ce1edc672156124c3189 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 18 May 2020 10:56:05 +0200 Subject: [PATCH] chore: Split CI into "rust" and "web" tests to speed up time --- .github/workflows/test_rust.yml | 50 +++++++++++++++++++ .../{test_build.yml => test_web.yml} | 28 ++--------- 2 files changed, 55 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/test_rust.yml rename .github/workflows/{test_build.yml => test_web.yml} (65%) diff --git a/.github/workflows/test_rust.yml b/.github/workflows/test_rust.yml new file mode 100644 index 000000000..b4cb9ce57 --- /dev/null +++ b/.github/workflows/test_rust.yml @@ -0,0 +1,50 @@ +name: Test Rust + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: Test rust ${{ matrix.rust_version }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.rust_version == 'nightly' }} + strategy: + fail-fast: false + matrix: + rust_version: ['stable', 'beta', 'nightly'] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v1 + + - name: Use stable rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust_version }} + override: true + components: rustfmt, clippy + + - name: Install linux depencencies + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get -y install libasound2-dev + + - name: Run all rust tests + uses: actions-rs/cargo@v1 + with: + command: test + + - name: Check clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all --tests -- -D warnings + + - name: Check rust formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_web.yml similarity index 65% rename from .github/workflows/test_build.yml rename to .github/workflows/test_web.yml index fa3b312b8..cfc4d4796 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_web.yml @@ -1,4 +1,4 @@ -name: Test Build +name: Test Web on: push: @@ -8,14 +8,15 @@ on: jobs: build: - name: Test rust ${{ matrix.rust_version }} / node ${{ matrix.node_version }} / ${{ matrix.os }} + name: Test node ${{ matrix.node_version }} / rust ${{ matrix.rust_version }} / ${{ matrix.os }} runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.rust_version == 'nightly' }} strategy: fail-fast: false matrix: + # We most likely don't care about rust versions here, we'll catch those issues in "test rust" node_version: ['10', '12'] - rust_version: ['stable', 'beta', 'nightly'] + rust_version: ['stable'] os: [ubuntu-latest, windows-latest, macOS-latest] steps: @@ -31,32 +32,13 @@ jobs: with: profile: minimal toolchain: ${{ matrix.rust_version }} - override: true - components: rustfmt, clippy - name: Install linux depencencies if: matrix.os == 'ubuntu-latest' run: sudo apt-get -y install libasound2-dev - name: Install wasm-pack - run: cargo install wasm-pack - - - name: Run all rust tests - uses: actions-rs/cargo@v1 - with: - command: test - - - name: Check clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all --tests -- -D warnings - - - name: Check rust formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo install wasm-pack - name: Install web working-directory: web