diff --git a/.github/workflows/ci-linter-pre_commit_hooks.yml b/.github/workflows/ci-linter-pre_commit_hooks.yml index 00ae2534e..09ce6554c 100644 --- a/.github/workflows/ci-linter-pre_commit_hooks.yml +++ b/.github/workflows/ci-linter-pre_commit_hooks.yml @@ -15,7 +15,7 @@ concurrency: jobs: swift_format: name: pre-commit hooks - runs-on: [self-hosted, iOS] + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -28,7 +28,26 @@ jobs: fetch-depth: 2 lfs: true - - uses: actions/cache@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + cache: "pip" + + - name: Install pre-commit + run: | + python -m pip install --upgrade pip + pip install pre-commit + pre-commit --version + + - name: Install tools + run: | + npm install -g ajv-cli + pre-commit install + pre-commit autoupdate + + - name: Cache pre-commit + uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: ${{ runner.os }}-pre-commit-${{ runner.name }}-${{ hashFiles('.pre-commit-config.yaml') }} @@ -45,4 +64,4 @@ jobs: - name: Run pre-commit hooks --files if: matrix.files == 'changed_files' run: | - pre-commit run --show-diff-on-failure --color=always --files $(git diff --name-only -r HEAD^1 HEAD) + pre-commit run --show-diff-on-failure --color=always --files $(git diff --name-only -r HEAD^1 HEAD --diff-filter=AMCR)