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 build github hosted #1647

Merged
merged 6 commits into from
Dec 18, 2024
Merged
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
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
Loading