From c67d69a369fb41f97a34b03b91df1e87ab48125b Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 17:41:52 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=91=B7=20(ci):=20Linter=20-=20SwiftLi?= =?UTF-8?q?nt=20-=20move=20to=20github=20hosted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-linter-swiftlint.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-linter-swiftlint.yml b/.github/workflows/ci-linter-swiftlint.yml index 4149329159..7c0a4cc4a7 100644 --- a/.github/workflows/ci-linter-swiftlint.yml +++ b/.github/workflows/ci-linter-swiftlint.yml @@ -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: | @@ -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 From 9268c85cd75be2c5514a0f8a773bacdd52a9aa63 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 18:02:45 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=91=B7=20(ci):=20Linter=20-=20SwiftFo?= =?UTF-8?q?rmat=20-=20move=20to=20github=20hosted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-linter-swiftformat.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-linter-swiftformat.yml b/.github/workflows/ci-linter-swiftformat.yml index 32be184577..ee20f6efb6 100644 --- a/.github/workflows/ci-linter-swiftformat.yml +++ b/.github/workflows/ci-linter-swiftformat.yml @@ -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: | @@ -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 From e49fa17a2bf66eee7fc5959c5ad6c132b1f058a5 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 22:58:16 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=91=B7=20(ci):=20Linter=20-=20License?= =?UTF-8?q?=20Checker=20-=20upgrade=20runs-on=20to=20ubuntu-24.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-linter-license_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-linter-license_checker.yml b/.github/workflows/ci-linter-license_checker.yml index 0cca374e34..5ca1c8925e 100644 --- a/.github/workflows/ci-linter-license_checker.yml +++ b/.github/workflows/ci-linter-license_checker.yml @@ -15,7 +15,7 @@ concurrency: jobs: license_checker: name: lint - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout From ce21fc68561069681ee6c1eadd0393d96792e239 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 23:05:39 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=91=B7=20(ci):=20Linter=20-=20pre-com?= =?UTF-8?q?mit=20-=20run=20on=20ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/ci-linter-pre_commit_hooks.yml | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-linter-pre_commit_hooks.yml b/.github/workflows/ci-linter-pre_commit_hooks.yml index 00ae2534e8..3628323ab1 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,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' @@ -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) From 229c9adad4095bcb0e28a23d3bc0882b9905c5dd Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Thu, 12 Dec 2024 16:21:57 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=91=B7=20(ci):=20Build=20-=20Add=20mi?= =?UTF-8?q?se=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-tuist-build.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tuist-build.yml b/.github/workflows/ci-tuist-build.yml index 6590e8ff12..dd38ef139a 100644 --- a/.github/workflows/ci-tuist-build.yml +++ b/.github/workflows/ci-tuist-build.yml @@ -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: |