From 850c0c83191dcf6b526f470b2ccec8ee29a2ec1e Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 19 Aug 2022 17:26:14 +0100 Subject: [PATCH] .github: workflows: Fix per commit buildability check Fetch the whole git repository (not just the specific commit) and use the github context instead of hardcoded branch. Unfortunately now that we process the list of revisions correctly it shows that the checks don't work on aarch64 due to cross limitations so this has been removed. Fixes: #4523 Signed-off-by: Rob Bradford --- .github/workflows/quality-aarch64.yaml | 8 ++------ .github/workflows/quality.yaml | 9 ++++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/quality-aarch64.yaml b/.github/workflows/quality-aarch64.yaml index 0dd567942..5680e8a61 100644 --- a/.github/workflows/quality-aarch64.yaml +++ b/.github/workflows/quality-aarch64.yaml @@ -21,7 +21,8 @@ jobs: experimental: true steps: - name: Code checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Install Rust toolchain (${{ matrix.rust }}) uses: actions-rs/toolchain@v1 with: @@ -30,11 +31,6 @@ jobs: override: true components: rustfmt, clippy - - name: Debug Check (default features) - run: | - git rev-list origin/main..$GITHUB_SHA | xargs -t -I % sh -c 'git checkout %; cargo check --tests --all --target=${{ matrix.target }}' - git checkout $GITHUB_SHA - - name: Formatting (rustfmt) run: cargo fmt -- --check diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index faca6c4fc..6f949b8b6 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -21,7 +21,10 @@ jobs: experimental: true steps: - name: Code checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install Rust toolchain (${{ matrix.rust }}) uses: actions-rs/toolchain@v1 with: @@ -32,8 +35,8 @@ jobs: - name: Debug Check (default features) run: | - git rev-list origin/main..$GITHUB_SHA | xargs -t -I % sh -c 'git checkout %; cargo check --tests --all --target=${{ matrix.target }}' - git checkout $GITHUB_SHA + git rev-list origin/${{ github.base_ref }}..${{ github.sha }} | xargs -t -I % sh -c 'git checkout %; cargo check --tests --all --target=${{ matrix.target }}' + git checkout ${{ github.sha }} - name: Formatting (rustfmt) run: cargo fmt -- --check