From 9cc28943aa65154a2caaff28526135236ff29e29 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Mon, 6 Mar 2023 21:00:56 -0500 Subject: [PATCH] CI: split into three actions (#636) --- .github/workflows/check-examples.yml | 48 ++++++++++++++++++++++++++++ .github/workflows/check.yml | 48 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-examples.yml create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check-examples.yml b/.github/workflows/check-examples.yml new file mode 100644 index 0000000..364fa6c --- /dev/null +++ b/.github/workflows/check-examples.yml @@ -0,0 +1,48 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test on ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - nightly + os: + - ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt + + - name: Add wasm32-unknown-unknown + run: rustup target add wasm32-unknown-unknown + + - name: Setup cargo-make + uses: davidB/rust-cargo-make@v1 + + - name: Cargo generate-lockfile + run: cargo generate-lockfile + + - name: Run Rustfmt + run: cargo fmt -- --check + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo check on all examples + run: cargo make check-examples diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..7891ea7 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,48 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test on ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - nightly + os: + - ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt + + - name: Add wasm32-unknown-unknown + run: rustup target add wasm32-unknown-unknown + + - name: Setup cargo-make + uses: davidB/rust-cargo-make@v1 + + - name: Cargo generate-lockfile + run: cargo generate-lockfile + + - name: Run Rustfmt + run: cargo fmt -- --check + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo check on all libraries + run: cargo make check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7b6029..e06a37a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,4 +45,4 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Run tests with all features - run: cargo make ci + run: cargo make test