Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actions/install-prek/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-amd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-image-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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'
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Loading