Skip to content

Commit

Permalink
🔀️ Merge branch 'ladislas/feature/ci-build-github-hosted' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Dec 18, 2024
2 parents faa6df5 + 5ad6a6b commit 09f1f18
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-linter-license_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
34 changes: 29 additions & 5 deletions .github/workflows/ci-linter-pre_commit_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,56 @@ concurrency:
jobs:
swift_format:
name: pre-commit hooks
runs-on: [self-hosted, iOS]
runs-on: ubuntu-24.04
strategy:
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:
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:
version: 2024.12.4
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
Expand All @@ -52,4 +76,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)
15 changes: 11 additions & 4 deletions .github/workflows/ci-linter-swiftformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ concurrency:
jobs:
swift_format:
name: swiftformat
runs-on: [self-hosted, iOS]
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:
Expand All @@ -34,9 +39,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: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci-linter-swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ concurrency:
jobs:
swift_format:
name: swiftlint
runs-on: [self-hosted, iOS]
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:
Expand Down
146 changes: 146 additions & 0 deletions .github/workflows/ci-tuist-build-github_hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# 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]
permissions:
pull-requests: write

steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2

- 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
10 changes: 10 additions & 0 deletions .github/workflows/ci-tuist-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -49,6 +54,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 }} \
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci-tuist-unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 09f1f18

Please sign in to comment.