From 6e872dbacc8c21b8aba01e5222b54e76ae043313 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Mon, 5 Feb 2024 19:53:46 +0800 Subject: [PATCH] CI: Run the main jobs on macOS arm64 as well --- .github/workflows/CI.yml | 31 ++++++++++++++++---------- .github/workflows/CIQuantaDisabled.yml | 28 ++++++++++++++--------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 75513740..f88007bb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,16 +31,22 @@ jobs: test: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ubuntu-latest strategy: # Continue running other jobs in the matrix even if one fails. fail-fast: false matrix: - rust: - - stable - - beta - - 1.65.0 # MSRV - - nightly # For checking minimum version dependencies. + platform: + - runner: ubuntu-latest # Ubuntu x86_64 + rust: stable + - runner: ubuntu-latest + rust: beta + - runner: ubuntu-latest + rust: 1.65.0 # MSRV + - runner: ubuntu-latest + rust: nightly # For checking the minimum version dependencies. + - runner: macos-14 # macOS arm64 + rust: stable + runs-on: ${{ matrix.platform.runner }} steps: - name: Checkout Moka @@ -48,7 +54,8 @@ jobs: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources # 2-core CPU (x86_64), 7 GB of RAM - - name: Show CPU into + - name: Show CPU into (Linux) + if: ${{ matrix.platform.runner == 'ubuntu-latest' }} run: | nproc lscpu @@ -56,22 +63,22 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: ${{ matrix.platform.rust }} - name: Downgrade dependencies to minimal versions (Nightly only) - if: ${{ matrix.rust == 'nightly' }} + if: ${{ matrix.platform.rust == 'nightly' }} run: cargo update -Z minimal-versions - name: Pin some dependencies to specific versions (Nightly only) - if: ${{ matrix.rust == 'nightly' }} + if: ${{ matrix.platform.rust == 'nightly' }} run: ./.ci_extras/pin-crate-vers-nightly.sh - name: Pin some dependencies to specific versions (MSRV only) - if: ${{ matrix.rust == '1.65.0' }} + if: ${{ matrix.platform.rust == '1.65.0' }} run: ./.ci_extras/pin-crate-vers-msrv.sh - name: Remove some examples (MSRV only) - if: ${{ matrix.rust == '1.65.0' }} + if: ${{ matrix.platform.rust == '1.65.0' }} run: ./.ci_extras/remove-examples-msrv.sh - name: Show cargo tree diff --git a/.github/workflows/CIQuantaDisabled.yml b/.github/workflows/CIQuantaDisabled.yml index 320be546..5b72eb45 100644 --- a/.github/workflows/CIQuantaDisabled.yml +++ b/.github/workflows/CIQuantaDisabled.yml @@ -31,16 +31,22 @@ jobs: test: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ubuntu-latest strategy: # Continue running other jobs in the matrix even if one fails. fail-fast: false matrix: - rust: - - stable - - beta - - 1.65.0 # MSRV - - nightly # For checking minimum version dependencies. + platform: + - runner: ubuntu-latest # Ubuntu x86_64 + rust: stable + - runner: ubuntu-latest + rust: beta + - runner: ubuntu-latest + rust: 1.65.0 # MSRV + - runner: ubuntu-latest + rust: nightly # For checking the minimum version dependencies. + - runner: macos-14 # macOS arm64 + rust: stable + runs-on: ${{ matrix.platform.runner }} steps: - name: Checkout Moka @@ -49,22 +55,22 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: ${{ matrix.platform.rust }} - name: Downgrade dependencies to minimal versions (Nightly only) - if: ${{ matrix.rust == 'nightly' }} + if: ${{ matrix.platform.rust == 'nightly' }} run: cargo update -Z minimal-versions - name: Pin some dependencies to specific versions (Nightly only) - if: ${{ matrix.rust == 'nightly' }} + if: ${{ matrix.platform.rust == 'nightly' }} run: ./.ci_extras/pin-crate-vers-nightly.sh - name: Pin some dependencies to specific versions (MSRV only) - if: ${{ matrix.rust == '1.65.0' }} + if: ${{ matrix.platform.rust == '1.65.0' }} run: ./.ci_extras/pin-crate-vers-msrv.sh - name: Remove some examples (MSRV only) - if: ${{ matrix.rust == '1.65.0' }} + if: ${{ matrix.platform.rust == '1.65.0' }} run: ./.ci_extras/remove-examples-msrv.sh - name: Run tests (debug, but no quanta feature)