Skip to content

Commit

Permalink
👷 (ci): Linter - pre-commit - run on ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Dec 10, 2024
1 parent 39fff01 commit 27becea
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/ci-linter-pre_commit_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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') }}
Expand All @@ -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)

0 comments on commit 27becea

Please sign in to comment.