From b6d1f158cf12a40e546ef00695baf23337e27dff Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 17:41:52 +0100 Subject: [PATCH 1/6] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-linter-swiftlint.yml b/.github/workflows/ci-linter-swiftlint.yml index 242ac519f..4a9e215d6 100644 --- a/.github/workflows/ci-linter-swiftlint.yml +++ b/.github/workflows/ci-linter-swiftlint.yml @@ -17,7 +17,7 @@ concurrency: jobs: swift_format: name: swiftlint - runs-on: [self-hosted, iOS] + runs-on: [ubuntu-24.04] steps: - name: Checkout From b6ec4437e6cec4deae5d6522efc8e89f47318187 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 18:02:45 +0100 Subject: [PATCH 2/6] =?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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-linter-swiftformat.yml b/.github/workflows/ci-linter-swiftformat.yml index 60609d43a..1a08a2f98 100644 --- a/.github/workflows/ci-linter-swiftformat.yml +++ b/.github/workflows/ci-linter-swiftformat.yml @@ -17,7 +17,7 @@ concurrency: jobs: swift_format: name: swiftformat - runs-on: [self-hosted, iOS] + runs-on: [ubuntu-24.04] steps: - name: Checkout @@ -34,9 +34,11 @@ jobs: cache: true - 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: | From c8ff958aee290654783dd92b385ff0b74b9b06f1 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 Dec 2024 23:05:39 +0100 Subject: [PATCH 3/6] =?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 | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-linter-pre_commit_hooks.yml b/.github/workflows/ci-linter-pre_commit_hooks.yml index 1c5b04589..3628323ab 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,6 +28,12 @@ jobs: fetch-depth: 2 lfs: true + - 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: @@ -35,12 +41,25 @@ jobs: install: true cache: true - - uses: actions/cache@v4 + - 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: pre-commit-${{ runner.name }}-${{ hashFiles('.pre-commit-config.yaml') }} + key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} restore-keys: | - pre-commit-${{ runner.name }}- + pre-commit-${{ runner.os }}- pre-commit- - name: Run pre-commit hooks --all-files @@ -52,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 9679f632b888b0d6e1700599ce05ae6307fe7d75 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Thu, 12 Dec 2024 16:21:57 +0100 Subject: [PATCH 4/6] =?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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci-tuist-build.yml b/.github/workflows/ci-tuist-build.yml index 45cda7147..3c5ff3d6c 100644 --- a/.github/workflows/ci-tuist-build.yml +++ b/.github/workflows/ci-tuist-build.yml @@ -49,6 +49,11 @@ jobs: install: true cache: true + - name: tuist version + run: | + time which tuist + time tuist version + - name: tuist install run: | TUIST_TURN_OFF_LINTERS=${{ env.TUIST_TURN_OFF_LINTERS }} \ From 4913a065525e5713f113f9f55231646fd7916dc5 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Thu, 12 Dec 2024 16:22:37 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=91=B7=20(ci):=20Build=20-=20run=20on?= =?UTF-8?q?=20github=20hosted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ci-tuist-build-github_hosted.yml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 .github/workflows/ci-tuist-build-github_hosted.yml diff --git a/.github/workflows/ci-tuist-build-github_hosted.yml b/.github/workflows/ci-tuist-build-github_hosted.yml new file mode 100644 index 000000000..d7c7345ab --- /dev/null +++ b/.github/workflows/ci-tuist-build-github_hosted.yml @@ -0,0 +1,141 @@ +# Leka - iOS Monorepo +# Copyright APF France handicap +# SPDX-License-Identifier: Apache-2.0 + +name: Tuist - Build (GitHub Hosted) + +on: + push: + branches: + - develop + paths: + - "**/*.swift" + - ".mise.toml" + pull_request: + types: [opened, synchronize, reopened] + paths: + - "**/*.swift" + - ".mise.toml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + TUIST_TURN_OFF_LINTERS: TRUE + TUIST_GENERATE_EXAMPLE_TARGETS: TRUE + TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG: FALSE + +jobs: + build: + name: build + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + TUIST_DEVELOPER_MODE: [TRUE, FALSE] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + + - name: Setup mise + uses: jdx/mise-action@v2 + with: + version: 2024.12.4 + install: true + cache: true + + - name: tuist version + run: | + which tuist + tuist version + + - name: Cache Xcode derived data + uses: irgaly/xcode-cache@v1 + with: + key: xcode-cache-tuist_build_github_hosted-DEVELOPER_MODE_${{ matrix.TUIST_DEVELOPER_MODE }}-${{ github.sha }} + restore-keys: | + xcode-cache-tuist_build_github_hosted-DEVELOPER_MODE_${{ matrix.TUIST_DEVELOPER_MODE }}- + xcode-cache-tuist_build_github_hosted- + xcode-cache- + delete-used-deriveddata-cache: true + swiftpm-package-resolved-file: Tuist/Package.resolved + use-default-mtime-targets: true + restore-mtime-targets: | + **/*.bin + **/*.gif + **/*.jpeg + **/*.jpg + **/*.mid + **/*.mp3 + **/*.pdf + **/*.png + **/*.svg + **/*.wav + **/*.json + **/*.xcstrings + **/*.mp4 + **/*.yml + + - name: Cache SPM data + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/org.swift.swiftpm + ~/Library/org.swift.swiftpm + key: spm-cache-tuist_build_github_hosted-DEVELOPER_MODE_${{ matrix.TUIST_DEVELOPER_MODE }}-${{ github.sha }} + restore-keys: | + spm-cache-tuist_build_github_hosted-DEVELOPER_MODE_${{ matrix.TUIST_DEVELOPER_MODE }}- + spm-cache-tuist_build_github_hosted- + spm-cache- + + - name: Cache tuist data + uses: actions/cache@v4 + with: + path: | + Tuist/.build/artifacts + Tuist/.build/checkouts + Tuist/.build/derived + Tuist/.build/workspace-state.json + key: spm-cache-tuist_build_github_hosted-DEVELOPER_MODE_${{ matrix.TUIST_DEVELOPER_MODE }}-${{ github.sha }} + restore-keys: | + spm-cache-tuist_build_github_hosted-DEVELOPER_MODE_${{ matrix.TUIST_DEVELOPER_MODE }}- + spm-cache-tuist_build_github_hosted- + spm-cache- + + - name: restore files' mtime + uses: chetan/git-restore-mtime-action@v2 + + - name: Config Xcode + run: | + xcodes select 16.1 + defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES + + - name: tuist install + run: | + TUIST_TURN_OFF_LINTERS=${{ env.TUIST_TURN_OFF_LINTERS }} \ + TUIST_GENERATE_EXAMPLE_TARGETS=${{ env.TUIST_GENERATE_EXAMPLE_TARGETS }} \ + TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG=${{ env.TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG }} \ + TUIST_DEVELOPER_MODE=${{ matrix.TUIST_DEVELOPER_MODE }} \ + tuist install + + - name: tuist generate + run: | + TUIST_TURN_OFF_LINTERS=${{ env.TUIST_TURN_OFF_LINTERS }} \ + TUIST_GENERATE_EXAMPLE_TARGETS=${{ env.TUIST_GENERATE_EXAMPLE_TARGETS }} \ + TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG=${{ env.TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG }} \ + TUIST_DEVELOPER_MODE=${{ matrix.TUIST_DEVELOPER_MODE }} \ + tuist generate --no-open + + - name: tuist build + run: | + + TUIST_TURN_OFF_LINTERS=${{ env.TUIST_TURN_OFF_LINTERS }} \ + TUIST_GENERATE_EXAMPLE_TARGETS=${{ env.TUIST_GENERATE_EXAMPLE_TARGETS }} \ + TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG=${{ env.TUIST_GENERATE_MODULES_AS_FRAMEWORKS_FOR_DEBUG }} \ + TUIST_DEVELOPER_MODE=${{ matrix.TUIST_DEVELOPER_MODE }} \ + tuist build From 5ad6a6b8f314377cad72c39753e1b1a0eedbec89 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Wed, 18 Dec 2024 13:52:25 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=93=88=20(ci):=20Collect=20Workflow?= =?UTF-8?q?=20Telemetry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-linter-license_checker.yml | 5 +++++ .github/workflows/ci-linter-pre_commit_hooks.yml | 5 +++++ .github/workflows/ci-linter-swiftformat.yml | 5 +++++ .github/workflows/ci-linter-swiftlint.yml | 5 +++++ .github/workflows/ci-tuist-build-github_hosted.yml | 5 +++++ .github/workflows/ci-tuist-build.yml | 5 +++++ .github/workflows/ci-tuist-unit_tests.yml | 5 +++++ 7 files changed, 35 insertions(+) diff --git a/.github/workflows/ci-linter-license_checker.yml b/.github/workflows/ci-linter-license_checker.yml index 5ca1c8925..9c0997428 100644 --- a/.github/workflows/ci-linter-license_checker.yml +++ b/.github/workflows/ci-linter-license_checker.yml @@ -16,8 +16,13 @@ jobs: license_checker: name: lint runs-on: ubuntu-24.04 + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci-linter-pre_commit_hooks.yml b/.github/workflows/ci-linter-pre_commit_hooks.yml index 3628323ab..58cd0e1f6 100644 --- a/.github/workflows/ci-linter-pre_commit_hooks.yml +++ b/.github/workflows/ci-linter-pre_commit_hooks.yml @@ -20,8 +20,13 @@ jobs: fail-fast: false matrix: files: [changed_files, all_files] + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci-linter-swiftformat.yml b/.github/workflows/ci-linter-swiftformat.yml index 1a08a2f98..1e92f7e60 100644 --- a/.github/workflows/ci-linter-swiftformat.yml +++ b/.github/workflows/ci-linter-swiftformat.yml @@ -18,8 +18,13 @@ jobs: swift_format: name: swiftformat runs-on: [ubuntu-24.04] + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci-linter-swiftlint.yml b/.github/workflows/ci-linter-swiftlint.yml index 4a9e215d6..1f40c8a6d 100644 --- a/.github/workflows/ci-linter-swiftlint.yml +++ b/.github/workflows/ci-linter-swiftlint.yml @@ -18,8 +18,13 @@ jobs: swift_format: name: swiftlint runs-on: [ubuntu-24.04] + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci-tuist-build-github_hosted.yml b/.github/workflows/ci-tuist-build-github_hosted.yml index d7c7345ab..e8d40a89d 100644 --- a/.github/workflows/ci-tuist-build-github_hosted.yml +++ b/.github/workflows/ci-tuist-build-github_hosted.yml @@ -34,8 +34,13 @@ jobs: fail-fast: false matrix: TUIST_DEVELOPER_MODE: [TRUE, FALSE] + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci-tuist-build.yml b/.github/workflows/ci-tuist-build.yml index 3c5ff3d6c..f7ca30884 100644 --- a/.github/workflows/ci-tuist-build.yml +++ b/.github/workflows/ci-tuist-build.yml @@ -34,8 +34,13 @@ jobs: fail-fast: false matrix: TUIST_DEVELOPER_MODE: [TRUE, FALSE] + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci-tuist-unit_tests.yml b/.github/workflows/ci-tuist-unit_tests.yml index f000bd60c..fbaf19f6b 100644 --- a/.github/workflows/ci-tuist-unit_tests.yml +++ b/.github/workflows/ci-tuist-unit_tests.yml @@ -28,8 +28,13 @@ jobs: unit_tests: name: unit tests runs-on: [self-hosted, iOS] + permissions: + pull-requests: write steps: + - name: Collect Workflow Telemetry + uses: catchpoint/workflow-telemetry-action@v2 + - name: Checkout uses: actions/checkout@v4 with: