diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml index ce12df1..9f5422f 100644 --- a/.github/workflows/compatibility_tests.yml +++ b/.github/workflows/compatibility_tests.yml @@ -9,6 +9,9 @@ on: jobs: compatibility_tests_macos: name: Execute compatibility tests + permissions: + contents: read + id-token: write strategy: fail-fast: false matrix: @@ -31,6 +34,18 @@ jobs: uses: OpenSwiftUIProject/setup-xcode@v2 with: xcode-version: ${{ matrix.xcode-version }} + - name: Set up mise + uses: jdx/mise-action@v2 + with: + install: false + cache: false + - name: Set up Tuist cache + run: | + mise trust mise.toml + mise install + mise exec -- tuist auth login + mise exec -- tuist setup cache + shell: bash - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash @@ -42,10 +57,18 @@ jobs: --build-path .build-compatibility-test-debug - name: Run tests against Apple's AttributeGraph on macOS via Xcode run: | - xcodebuild test \ + result_bundle="${RUNNER_TEMP:-/tmp}/openattributegraph-compatibility-macos-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-0}.xcresult" + rm -rf "$result_bundle" + trap 'rm -rf "$result_bundle"' EXIT + mise exec -- tuist xcodebuild test \ -workspace .swiftpm/xcode/package.xcworkspace \ -scheme OpenAttributeGraph-Package \ -sdk macosx \ -destination "platform=macOS" \ + -resultBundlePath "$result_bundle" \ -skipPackagePluginValidation \ - -skipMacroValidation + -skipMacroValidation \ + COMPILATION_CACHE_ENABLE_CACHING=YES \ + COMPILATION_CACHE_REMOTE_SERVICE_PATH="$HOME/.local/state/tuist/OpenSwiftUIProject_openattributegraph.sock" \ + COMPILATION_CACHE_ENABLE_PLUGIN=YES \ + COMPILATION_CACHE_ENABLE_DIAGNOSTIC_REMARKS=YES diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 239f5ef..91dcefc 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -57,6 +57,9 @@ jobs: compute_ios_build: name: Build with Compute (binary) on iOS + permissions: + contents: read + id-token: write strategy: fail-fast: false matrix: @@ -79,14 +82,34 @@ jobs: uses: OpenSwiftUIProject/setup-xcode@v2 with: xcode-version: ${{ matrix.xcode-version }} + - name: Set up mise + uses: jdx/mise-action@v2 + with: + install: false + cache: false + - name: Set up Tuist cache + run: | + mise trust mise.toml + mise install + mise exec -- tuist auth login + mise exec -- tuist setup cache + shell: bash - name: Build in debug mode on iOS Simulator run: | - xcodebuild build \ + result_bundle="${RUNNER_TEMP:-/tmp}/openattributegraph-compute-ios-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-0}.xcresult" + rm -rf "$result_bundle" + trap 'rm -rf "$result_bundle"' EXIT + mise exec -- tuist xcodebuild build \ -workspace .swiftpm/xcode/package.xcworkspace \ -scheme OpenAttributeGraph \ -configuration Debug \ -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ -derivedDataPath .build-debug \ + -resultBundlePath "$result_bundle" \ -skipMacroValidation \ -skipPackagePluginValidation \ - OTHER_SWIFT_FLAGS="-warnings-as-errors" + OTHER_SWIFT_FLAGS="-warnings-as-errors" \ + COMPILATION_CACHE_ENABLE_CACHING=YES \ + COMPILATION_CACHE_REMOTE_SERVICE_PATH="$HOME/.local/state/tuist/OpenSwiftUIProject_openattributegraph.sock" \ + COMPILATION_CACHE_ENABLE_PLUGIN=YES \ + COMPILATION_CACHE_ENABLE_DIAGNOSTIC_REMARKS=YES diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 90b4f50..ecec55e 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -9,6 +9,9 @@ on: jobs: ios_test: name: Execute tests on iOS + permissions: + contents: read + id-token: write strategy: fail-fast: false matrix: @@ -33,35 +36,63 @@ jobs: uses: OpenSwiftUIProject/setup-xcode@v2 with: xcode-version: ${{ matrix.xcode-version }} + - name: Set up mise + uses: jdx/mise-action@v2 + with: + install: false + cache: false + - name: Set up Tuist cache + run: | + mise trust mise.toml + mise install + mise exec -- tuist auth login + mise exec -- tuist setup cache + shell: bash - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash - name: Build in debug mode on iOS run: | + result_bundle="${RUNNER_TEMP:-/tmp}/openattributegraph-ios-build-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-0}.xcresult" + rm -rf "$result_bundle" + trap 'rm -rf "$result_bundle"' EXIT # Swift 6.2.4 crashes while indexing C++ interop test targets. - xcodebuild build \ + mise exec -- tuist xcodebuild build \ -workspace .swiftpm/xcode/package.xcworkspace \ -scheme OpenAttributeGraph-Package \ -configuration Debug \ -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ -derivedDataPath .build-debug \ + -resultBundlePath "$result_bundle" \ -skipMacroValidation \ -skipPackagePluginValidation \ COMPILER_INDEX_STORE_ENABLE=NO \ - OTHER_SWIFT_FLAGS="-warnings-as-errors" + OTHER_SWIFT_FLAGS="-warnings-as-errors" \ + COMPILATION_CACHE_ENABLE_CACHING=YES \ + COMPILATION_CACHE_REMOTE_SERVICE_PATH="$HOME/.local/state/tuist/OpenSwiftUIProject_openattributegraph.sock" \ + COMPILATION_CACHE_ENABLE_PLUGIN=YES \ + COMPILATION_CACHE_ENABLE_DIAGNOSTIC_REMARKS=YES - name: Build and run tests in debug mode with coverage on iOS Simulator run: | + result_bundle="${RUNNER_TEMP:-/tmp}/openattributegraph-ios-test-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-0}.xcresult" + rm -rf "$result_bundle" + trap 'rm -rf "$result_bundle"' EXIT # Swift 6.2.4 crashes while indexing C++ interop test targets. - xcodebuild test \ + mise exec -- tuist xcodebuild test \ -workspace .swiftpm/xcode/package.xcworkspace \ -scheme OpenAttributeGraph-Package \ -configuration Debug \ -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ -enableCodeCoverage=YES \ -derivedDataPath .build-test-debug \ + -resultBundlePath "$result_bundle" \ -skipPackagePluginValidation \ -skipMacroValidation \ - COMPILER_INDEX_STORE_ENABLE=NO + COMPILER_INDEX_STORE_ENABLE=NO \ + COMPILATION_CACHE_ENABLE_CACHING=YES \ + COMPILATION_CACHE_REMOTE_SERVICE_PATH="$HOME/.local/state/tuist/OpenSwiftUIProject_openattributegraph.sock" \ + COMPILATION_CACHE_ENABLE_PLUGIN=YES \ + COMPILATION_CACHE_ENABLE_DIAGNOSTIC_REMARKS=YES # OTHER_SWIFT_FLAGS="-warnings-as-errors" Conflicting options '-warnings-as-errors' and '-suppress-warnings' - name: Generate iOS coverage report run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44a2a8c..dcf2a10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,7 @@ jobs: runs-on: macos-15 permissions: contents: write + id-token: write env: GH_TOKEN: ${{ github.token }} steps: @@ -22,17 +23,31 @@ jobs: uses: OpenSwiftUIProject/setup-xcode@v2 with: xcode-version: "26.3" + - name: Set up mise + uses: jdx/mise-action@v2 + with: + install: false + cache: false + - name: Set up Tuist cache + run: | + mise trust mise.toml + mise install + mise exec -- tuist auth login + mise exec -- tuist setup cache + shell: bash - name: Build XCFramework run: ./Scripts/build_xcframework.sh - name: Compute Checksum id: checksum run: | - echo "checksum=$(swift package compute-checksum .build/Xcode/Frameworks/OpenAttributeGraph.xcframework.zip)" >> $GITHUB_OUTPUT + echo "checksum=$(swift package compute-checksum .build/Xcode/Frameworks/OpenAttributeGraph.xcframework.zip)" >> "$GITHUB_OUTPUT" - name: Collect Build Info id: build_info run: | - echo "xcode_version=$(xcodebuild -version | head -1)" >> $GITHUB_OUTPUT - echo "swift_version=$(swift --version 2>&1 | head -1)" >> $GITHUB_OUTPUT + { + echo "xcode_version=$(xcodebuild -version | head -1)" + echo "swift_version=$(swift --version 2>&1 | head -1)" + } >> "$GITHUB_OUTPUT" - name: Generate Release Notes run: | TAG_NAME="${GITHUB_REF#refs/tags/}" diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index f80aee3..08f4e4f 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -9,6 +9,9 @@ on: jobs: build_xcframework: name: Build XCFramework + permissions: + contents: read + id-token: write strategy: fail-fast: false matrix: @@ -25,6 +28,18 @@ jobs: uses: OpenSwiftUIProject/setup-xcode@v2 with: xcode-version: ${{ matrix.xcode-version }} + - name: Set up mise + uses: jdx/mise-action@v2 + with: + install: false + cache: false + - name: Set up Tuist cache + run: | + mise trust mise.toml + mise install + mise exec -- tuist auth login + mise exec -- tuist setup cache + shell: bash - name: Build XCFramework run: ./Scripts/build_xcframework.sh - name: Upload XCFramework diff --git a/Example/Project.swift b/Example/Project.swift index 5c3aec6..c5c7061 100644 --- a/Example/Project.swift +++ b/Example/Project.swift @@ -7,6 +7,9 @@ let indexStoreDisabledSettings: SettingsDictionary = [ let project = Project( name: "Example", + packages: [ + .package(path: ".."), + ], settings: .settings(base: indexStoreDisabledSettings), targets: [ .target( @@ -18,7 +21,7 @@ let project = Project( sources: ["Sources/**"], dependencies: [ .sdk(name: "c++", type: .library), - .external(name: "OpenAttributeGraph"), + .package(product: "OpenAttributeGraph"), ], settings: .settings(base: indexStoreDisabledSettings) ), diff --git a/Example/Tuist.swift b/Example/Tuist.swift index abf9ffd..7e779cc 100644 --- a/Example/Tuist.swift +++ b/Example/Tuist.swift @@ -1,5 +1,13 @@ import ProjectDescription let tuist = Tuist( - project: .tuist() + fullHandle: "OpenSwiftUIProject/openattributegraph", + xcodeCache: .xcodeCache( + upload: Environment.isCI + ), + project: .tuist( + generationOptions: .options( + enableCaching: true + ) + ) ) diff --git a/Example/Tuist/Package.resolved b/Example/Tuist/Package.resolved deleted file mode 100644 index e8cf1f6..0000000 --- a/Example/Tuist/Package.resolved +++ /dev/null @@ -1,15 +0,0 @@ -{ - "originHash" : "b4d69cd3c6294a612f2691e0c9ace37d5e8c8904296914f23e337abb762050c2", - "pins" : [ - { - "identity" : "swift-numerics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-numerics", - "state" : { - "revision" : "0c0290ff6b24942dadb83a929ffaaa1481df04a2", - "version" : "1.1.1" - } - } - ], - "version" : 3 -} diff --git a/Example/Tuist/Package.swift b/Example/Tuist/Package.swift index 9384c66..e18a677 100644 --- a/Example/Tuist/Package.swift +++ b/Example/Tuist/Package.swift @@ -17,8 +17,5 @@ let packageSettings = PackageSettings( let package = Package( name: "ExampleDependencies", - dependencies: [ - .package(path: "../../"), - .package(url: "https://github.com/apple/swift-numerics", from: "1.1.1"), - ] + dependencies: [] ) diff --git a/Example/mise.toml b/Example/mise.toml index 9d16c18..cc14d05 100644 --- a/Example/mise.toml +++ b/Example/mise.toml @@ -1,2 +1,2 @@ [tools] -tuist = "4.193.0" +tuist = "4.203.0-rc.1" diff --git a/Scripts/build_xcframework.sh b/Scripts/build_xcframework.sh index 603ded8..385f7b8 100755 --- a/Scripts/build_xcframework.sh +++ b/Scripts/build_xcframework.sh @@ -42,25 +42,36 @@ done echo "Building xcframework for $SCHEME (debug info: $DEBUG_INFO)" # Archive for each platform using the Tuist-generated xcodeproj -xcodebuild archive \ +rm -rf \ + "$BUILD_DIR/Archives/$SCHEME-macOS.xcarchive" \ + "$BUILD_DIR/Archives/$SCHEME-macOS.xcresult" \ + "$BUILD_DIR/Archives/$SCHEME-iOS.xcarchive" \ + "$BUILD_DIR/Archives/$SCHEME-iOS.xcresult" \ + "$BUILD_DIR/Archives/$SCHEME-iOS-Simulator.xcarchive" \ + "$BUILD_DIR/Archives/$SCHEME-iOS-Simulator.xcresult" + +tuist xcodebuild archive \ -project "$XCODEPROJ" \ -scheme "$SCHEME" \ -destination "generic/platform=macOS" \ -archivePath "$BUILD_DIR/Archives/$SCHEME-macOS.xcarchive" \ + -resultBundlePath "$BUILD_DIR/Archives/$SCHEME-macOS.xcresult" \ ENABLE_USER_SCRIPT_SANDBOXING=NO -xcodebuild archive \ +tuist xcodebuild archive \ -project "$XCODEPROJ" \ -scheme "$SCHEME" \ -destination "generic/platform=iOS" \ -archivePath "$BUILD_DIR/Archives/$SCHEME-iOS.xcarchive" \ + -resultBundlePath "$BUILD_DIR/Archives/$SCHEME-iOS.xcresult" \ ENABLE_USER_SCRIPT_SANDBOXING=NO -xcodebuild archive \ +tuist xcodebuild archive \ -project "$XCODEPROJ" \ -scheme "$SCHEME" \ -destination "generic/platform=iOS Simulator" \ -archivePath "$BUILD_DIR/Archives/$SCHEME-iOS-Simulator.xcarchive" \ + -resultBundlePath "$BUILD_DIR/Archives/$SCHEME-iOS-Simulator.xcresult" \ ENABLE_USER_SCRIPT_SANDBOXING=NO echo "Archives completed successfully." diff --git a/Tuist.swift b/Tuist.swift index a1d5230..191f66b 100644 --- a/Tuist.swift +++ b/Tuist.swift @@ -1,8 +1,13 @@ import ProjectDescription let tuist = Tuist( + fullHandle: "OpenSwiftUIProject/openattributegraph", + xcodeCache: .xcodeCache( + upload: Environment.isCI + ), project: .tuist( generationOptions: .options( + enableCaching: true, manifestEnvironment: [ "OPENSWIFTUI_*", "OPENATTRIBUTEGRAPH_*", diff --git a/mise.toml b/mise.toml index 82eb7c5..cc14d05 100644 --- a/mise.toml +++ b/mise.toml @@ -1,2 +1,2 @@ [tools] -tuist = "4.156.0" +tuist = "4.203.0-rc.1"