diff --git a/.github/actions/install-prek/action.yml b/.github/actions/install-prek/action.yml index 2841ed1608f9f..7f9627805a62d 100644 --- a/.github/actions/install-prek/action.yml +++ b/.github/actions/install-prek/action.yml @@ -31,6 +31,9 @@ inputs: skip-prek-hooks: description: "Skip some prek hooks from installation" default: "" + platform: + description: 'Platform for the build - linux/amd64 or linux/arm64' + required: true runs: using: "composite" steps: @@ -57,7 +60,8 @@ runs: - name: "Restore prek cache" uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468 with: - key: cache-prek-v5-${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} + # yamllint disable rule:line-length + key: cache-prek-v6-${{ inputs.platform }}-${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} path: /tmp/ id: restore-prek-cache - name: "Check if prek cache tarball exists" diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index d289793ac007a..99559f2cfb47b 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -60,6 +60,10 @@ on: # yamllint disable-line rule:truthy description: "Whether to use uv in the image" required: true type: string + platform: + description: 'Platform for the build - linux/amd64 or linux/arm64' + required: true + type: string permissions: contents: read jobs: @@ -174,6 +178,7 @@ jobs: with: python-version: ${{steps.breeze.outputs.host-python-version}} skip-prek-hooks: ${{ inputs.skip-prek-hooks }} + platform: ${{ inputs.platform }} # Those checks are run if no image needs to be built for checks. This is for simple changes that # Do not touch any of the python code or any of the important files that might require building @@ -203,6 +208,7 @@ jobs: with: python-version: ${{ steps.breeze.outputs.host-python-version }} skip-prek-hooks: ${{ inputs.skip-prek-hooks }} + platform: ${{ inputs.platform }} - name: Fetch incoming commit ${{ github.sha }} with its parent uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: @@ -257,6 +263,7 @@ jobs: with: python-version: ${{steps.breeze.outputs.host-python-version}} skip-prek-hooks: ${{ inputs.skip-prek-hooks }} + platform: ${{ inputs.platform }} # TODO(potiuk): enable this once prek supports automatic upgrade of hooks # after https://github.com/j178/prek/issues/35 is implemented§ # - name: "Autoupdate all prek hooks" diff --git a/.github/workflows/ci-amd.yml b/.github/workflows/ci-amd.yml index 68d7e4c5c3d7e..309c8f26dc163 100644 --- a/.github/workflows/ci-amd.yml +++ b/.github/workflows/ci-amd.yml @@ -212,6 +212,7 @@ jobs: canary-run: ${{needs.build-info.outputs.canary-run}} latest-versions-only: ${{needs.build-info.outputs.latest-versions-only}} use-uv: ${{needs.build-info.outputs.use-uv}} + platform: "linux/amd64" build-ci-images: name: Build CI images diff --git a/.github/workflows/ci-arm.yml b/.github/workflows/ci-arm.yml index f7fbc9ae312b2..bc140d822382b 100644 --- a/.github/workflows/ci-arm.yml +++ b/.github/workflows/ci-arm.yml @@ -175,6 +175,7 @@ jobs: canary-run: ${{needs.build-info.outputs.canary-run}} latest-versions-only: ${{needs.build-info.outputs.latest-versions-only}} use-uv: ${{needs.build-info.outputs.use-uv}} + platform: "linux/arm64" build-ci-images: name: Build CI images diff --git a/.github/workflows/ci-image-checks.yml b/.github/workflows/ci-image-checks.yml index cd0c627ae11e9..e209aca95a615 100644 --- a/.github/workflows/ci-image-checks.yml +++ b/.github/workflows/ci-image-checks.yml @@ -148,6 +148,7 @@ jobs: id: prek with: python-version: ${{steps.breeze.outputs.host-python-version}} + platform: ${{ inputs.platform }} if: inputs.canary-run == 'true' - name: "Prepare .tar file from prek cache" run: | @@ -158,7 +159,7 @@ jobs: uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468 with: # yamllint disable rule:line-length - key: cache-prek-v5-${{ steps.breeze.outputs.host-python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} + key: cache-prek-v6-${{ inputs.platform }}-${{ steps.breeze.outputs.host-python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} path: /tmp/cache-prek.tar.gz if-no-files-found: 'error' retention-days: '2' @@ -194,6 +195,7 @@ jobs: id: prek with: python-version: ${{steps.breeze.outputs.host-python-version}} + platform: ${{ inputs.platform }} - name: "Static checks" run: prek --all-files --show-diff-on-failure --color always env: @@ -237,6 +239,7 @@ jobs: id: prek with: python-version: ${{steps.breeze.outputs.host-python-version}} + platform: ${{ inputs.platform }} - name: "MyPy checks for ${{ matrix.mypy-check }}" run: prek --color always --verbose --hook-stage manual "$MYPY_CHECK" --all-files env: