Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ladislas/feature/ci use github hosted improve speed cache #1644

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-linter-license_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
jobs:
license_checker:
name: lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand Down
38 changes: 32 additions & 6 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,13 +28,39 @@ 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: Set up mise
uses: jdx/mise-action@v2
with:
version: 2024.12.4
install: true
cache: true

- 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') }}
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-${{ runner.name }}-
${{ runner.os }}-pre-commit-
pre-commit-${{ runner.os }}-
pre-commit-

- name: Run pre-commit hooks --all-files
if: matrix.files == 'all_files'
Expand All @@ -45,4 +71,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)
20 changes: 14 additions & 6 deletions .github/workflows/ci-linter-swiftformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ concurrency:
jobs:
swift_format:
name: swiftformat
runs-on: [self-hosted, iOS]
runs-on: [ubuntu-24.04]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
fetch-depth: 0
lfs: false

- name: Setup mise
run: |
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
mise install
uses: jdx/mise-action@v2
with:
version: 2024.12.4
install: true
cache: true

- name: Run swiftformat
run: |
Expand All @@ -39,4 +41,10 @@ jobs:
which swiftformat
swiftformat --version

swiftformat --lint --reporter github-actions-log .
git diff origin/develop --name-only --diff-filter=AMCR \
| grep -E "\.swift\$$" \
|| echo "No files added nor modified!"

git diff origin/develop --name-only --diff-filter=AMCR \
| grep -E "\.swift\$$" \
| xargs --no-run-if-empty swiftformat --lint --reporter github-actions-log --verbose
16 changes: 9 additions & 7 deletions .github/workflows/ci-linter-swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ concurrency:
jobs:
swift_format:
name: swiftlint
runs-on: [self-hosted, iOS]
runs-on: [ubuntu-24.04]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
fetch-depth: 0
lfs: false

- name: Setup mise
run: |
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
mise install
uses: jdx/mise-action@v2
with:
version: 2024.12.4
install: true
cache: true

- name: Run swiftlint
run: |
Expand All @@ -39,10 +41,10 @@ jobs:
which swiftlint
swiftlint --version

git diff origin/main --name-only --diff-filter=AMCR \
git diff origin/develop --name-only --diff-filter=AMCR \
| grep -E "\.swift\$$" \
|| echo "No files added nor modified!"

git diff origin/main --name-only --diff-filter=AMCR \
git diff origin/develop --name-only --diff-filter=AMCR \
| grep -E "\.swift\$$" \
| xargs --no-run-if-empty swiftlint lint --quiet --reporter github-actions-logging
13 changes: 10 additions & 3 deletions .github/workflows/ci-tuist-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1 # shallow clone
fetch-depth: 1
lfs: true

- name: Setup mise
uses: jdx/mise-action@v2
with:
version: 2024.12.4
install: true
cache: true

- name: tuist version
run: |
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
mise install
time which tuist
time tuist version

- name: tuist install
run: |
Expand Down
Loading