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

Tuist project configuration #301

Merged
merged 11 commits into from
Sep 25, 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
9 changes: 4 additions & 5 deletions .buildscript/build_swift_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Usage: ./build_swift_docs.sh OUTPUT_DIR

SOURCEDOCS_OUTPUT_DIR="$1"
WORKFLOW_SCHEMES="Workflow WorkflowUI WorkflowTesting"
WORKFLOW_SCHEMES="ViewEnvironment ViewEnvironmentUI Workflow WorkflowUI WorkflowSwiftUI WorkflowTesting"

if [[ -z "$SOURCEDOCS_OUTPUT_DIR" ]]; then
echo "No output dir specified. Usage: \`build_swift_docs.sh [OUTPUT_DIR]\`"
Expand All @@ -32,15 +32,14 @@ fi

set -ex

# Prepare the Xcode project.
bundle exec pod gen Development.podspec
cd gen/Development
tuist install --path Samples
tuist generate --path Samples --no-open

# Generate the API docs.
for scheme in $WORKFLOW_SCHEMES; do
sourcedocs generate \
--output-folder "$SOURCEDOCS_OUTPUT_DIR/$scheme" \
-- \
-scheme $scheme \
-workspace Development.xcworkspace
-workspace Samples/Development.xcworkspace
done
144 changes: 0 additions & 144 deletions .github/workflows/release.yml

This file was deleted.

117 changes: 20 additions & 97 deletions .github/workflows/swift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,32 @@ on:
env:
XCODE_VERSION: 15.1
IOS_DESTINATION: platform=iOS Simulator,OS=17.2,name=iPad (10th generation)
TUIST_TEST_DEVICE: iPad (10th generation)
TUIST_TEST_PLATFORM: iOS
TUIST_TEST_OS: 17.2

jobs:
development-apps:
development-tests:
runs-on: macos-latest

strategy:
matrix:
scheme:
- Development-Unit-WorkflowTesting
- Development-Unit-WorkflowTests
- Development-Unit-WorkflowUITests
- Development-Unit-SplitScreenTests
- Development-Unit-TicTacToeTests
- Development-Unit-WorkflowReactiveSwiftTests
- Development-Unit-WorkflowRxSwiftTests
- Development-Unit-WorkflowReactiveSwiftTestingTests
- Development-Unit-WorkflowRxSwiftTestingTests

steps:
- uses: actions/checkout@v4

- 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 gen Development.podspec

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

- name: Build & Test
run: |
set -o pipefail
xcodebuild \
-workspace gen/Development/Development.xcworkspace \
-scheme ${{ matrix.scheme }} \
-destination "$IOS_DESTINATION" \
build test | bundle exec xcpretty

xcodegen-apps:
runs-on: macos-latest
- UnitTests
- SnapshotTests

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

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

- name: Install XcodeGen
run: brew install xcodegen
- name: Install dependencies
run: tuist install --path Samples

- name: Generate Xcode project
run: xcodegen generate

- name: ObservableScreen
run: |
xcodebuild \
-project Workflow.xcodeproj \
-scheme "ObservableScreen" \
-destination "$IOS_DESTINATION" \
-skipMacroValidation \
build
- name: Test iOS
run: tuist test --path Samples ${{ matrix.scheme }}

package-tests:
runs-on: macos-latest
Expand All @@ -85,70 +45,33 @@ jobs:
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app

- name: Install XcodeGen
run: brew install xcodegen

- name: Generate Xcode project
run: xcodegen generate

# Macros are only built for the compiler platform, so we cannot run macro tests on iOS. Instead
# we target a scheme from project.yml which selectively includes all the other tests.
- name: Tests - iOS
run: |
xcodebuild \
-project Workflow.xcodeproj \
-scheme "Tests-iOS" \
-destination "$IOS_DESTINATION" \
-skipMacroValidation \
test

# Command line swift runs on the host platform.
# On macOS we can run all tests, including macro tests.
- name: Tests - macOS
run: |
xcodebuild \
-project Workflow.xcodeproj \
-scheme "Tests-All" \
-destination "platform=macOS" \
-skipMacroValidation \
test
- name: Test macOS
run: swift test

tutorial:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- 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
- uses: jdx/mise-action@v2

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

- name: Install dependencies
run: tuist install --path Samples/Tutorial

- name: Tutorial App
run: |
cd Samples/Tutorial
bundle exec pod install
set -o pipefail
xcodebuild \
-workspace Tutorial.xcworkspace \
-scheme Tutorial \
-destination "$IOS_DESTINATION" \
build test | bundle exec xcpretty
run: tuist test --path Samples/Tutorial TutorialTests

documentation-lint:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- 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
- uses: jdx/mise-action@v2

- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app
Expand Down
18 changes: 7 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ gen/
# Xcode
xcuserdata/

# Sample workspace
SampleApp.xcworkspace

# XcodeGen
Workflow.xcodeproj/
/TestingSupport/AppHost/App/Info.plist
# Tuist
/Derived
/Samples/Derived
/Samples/Tutorial/Derived
/Samples/*.xcodeproj
/Samples/*.xcworkspace
/*.xcodeproj

# ios-snapshot-test-case Failure Diffs
FailureDiffs/

Samples/**/*Info.plist
!Samples/Tutorial/AppHost/Configuration/Info.plist
!Samples/Tutorial/AppHost/TutorialTests/Info.plist
!Samples/AsyncWorker/AsyncWorker/Info.plist
7 changes: 7 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tools]
tuist = "4.23.0"
swiftformat = "0.54.2"

[settings]
# do not try to read versions from .nvmrc, .ruby-version, etc.
legacy_version_file = false
Loading
Loading