From 46722e99112390c01c404c90d3dc95ecb5b7da85 Mon Sep 17 00:00:00 2001 From: Michael Weirauch Date: Tue, 16 Jul 2024 18:15:06 +0200 Subject: [PATCH] WIP --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6fd313..062e0fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,13 @@ jobs: steps: - name: Skip Check id: skip_check - uses: fkirc/skip-duplicate-actions@v5 + # uses: fkirc/skip-duplicate-actions@v5 # FIXME: doesn't work? + run: | + if [[ "${{ github.event_name }}" != 'pull_request' || "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.pull_request.base.repo.full_name }}" ]]; then + echo "should_skip=false" >> $GITHUB_ENV + else + echo "should_skip=true" >> $GITHUB_ENV + fi lint: name: Lint @@ -32,7 +38,8 @@ jobs: toolchain: stable components: rustfmt - - uses: Swatinem/rust-cache@v2 + - name: Set up cache + uses: Swatinem/rust-cache@v2 - name: Run cargo fmt run: cargo fmt --all -- --check @@ -43,10 +50,19 @@ jobs: if: needs.check-duplicate-runs.outputs.should_skip != 'true' strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest + include: + - name: Linux (x86_64) + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - name: MacOS (x86_64) + os: macos-latest + target: x86_64-apple-darwin + - name: MacOS (aarch64) + os: macos-latest + target: aarch64-apple-darwin + - name: Windows (x86_64) + os: windows-latest + target: x86_64-pc-windows-msvc runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -56,6 +72,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: stable + targets: ${{ matrix.target }} components: clippy # - name: Cache cargo files @@ -69,7 +86,8 @@ jobs: # target/ # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - uses: Swatinem/rust-cache@v2 + - name: Set up cache + uses: Swatinem/rust-cache@v2 - name: Run cargo check run: cargo check --all-targets