Skip to content

Commit

Permalink
ci: update for tuist
Browse files Browse the repository at this point in the history
  • Loading branch information
watt committed Dec 2, 2024
1 parent 6b7d087 commit 93deb35
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 57 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,13 @@ jobs:
runs-on: macos-14-xlarge

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2

- name: Read env
run: cat .github/workflows/env.properties >> $GITHUB_ENV
- name: Run swiftformat
run: swiftformat --lint .

- name: Switch to Xcode ${{ env.xcode_version }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app

- name: Cache SPM build
uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Run SwiftFormat
run: |
swift run -c release swiftformat --lint .
- name: Report error
if: ${{ failure() }}
run: |
echo '::error::SwiftFormat linting failed. Run `Scripts/swiftformat` to format your code.'
- name: Report error
if: ${{ failure() }}
run: |
echo '::error::SwiftFormat linting failed. Run `Scripts/swiftformat` to format your code.'
51 changes: 17 additions & 34 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,31 @@ jobs:
matrix:
include:
- sdk: "15.4"
destination: platform=iOS Simulator,OS=15.4,name=iPhone SE (3rd generation)
env:
TUIST_TEST_DEVICE: iPhone SE (3rd generation)
TUIST_TEST_PLATFORM: iOS
TUIST_TEST_OS: {{ matrix.sdk }}
installation_required: true

- sdk: "16.2"
destination: platform=iOS Simulator,OS=16.2,name=iPhone SE (3rd generation)
env:
TUIST_TEST_DEVICE: iPhone SE (3rd generation)
TUIST_TEST_PLATFORM: iOS
TUIST_TEST_OS: {{ matrix.sdk }}
installation_required: true

- sdk: "17.2"
destination: platform=iOS Simulator,OS=17.2,name=iPhone SE (3rd generation)
env:
TUIST_TEST_DEVICE: iPhone SE (3rd generation)
TUIST_TEST_PLATFORM: iOS
TUIST_TEST_OS: {{ matrix.sdk }}
# The iOS 17.2 SDK is pre-installed on the macOS 13 image.
# Attempting to install it will fail with an error.
installation_required: false

steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2

- name: Read env
run: cat .github/workflows/env.properties >> $GITHUB_ENV
Expand All @@ -46,9 +56,11 @@ jobs:
if: ${{ matrix.installation_required }}
run: sudo xcodes runtimes install "iOS ${{ matrix.sdk }}"

- name: Install dependencies
run: tuist install --path SampleApp

- name: Build & Test
run: |
xcodebuild -scheme "BlueprintUI-Package" -destination "${{ matrix.destination }}" build test
run: tuist test --path SampleApp UnitTests

- name: Package snapshot changes
if: ${{ failure() }}
Expand All @@ -61,32 +73,3 @@ jobs:
with:
name: snapshot_changes_${{ matrix.sdk }}
path: snapshot_changes_${{ matrix.sdk }}.tar


cocoapods:
name: "CocoaPods"

runs-on: macos-14-xlarge

steps:
- uses: actions/checkout@v4

- name: Read env
run: cat .github/workflows/env.properties >> $GITHUB_ENV

- name: Switch to Xcode ${{ env.xcode_version }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
# Uses version specified in .ruby_version
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Pod Install
run: |
bundle exec pod install --project-directory=SampleApp/
- name: Build & Test
run: |
xcodebuild -workspace SampleApp/SampleApp.xcworkspace -scheme "BlueprintUI-Unit-Tests" -destination "platform=iOS Simulator,OS=17.2,name=iPhone SE (3rd generation)"

0 comments on commit 93deb35

Please sign in to comment.