Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
- 'docs/**'
- '**/*.md'
concurrency:
group: main-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
group: main_${{ github.ref }}
cancel_in_progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
warm-up-release-app-cache:
warm_up_release_app_cache:
runs-on: macos-26
timeout-minutes: 60
steps:
Expand All @@ -31,7 +31,7 @@ jobs:
uses: actions/cache@v4
with:
path: local-server/node_modules
key: ${{ runner.os }}-npm-modules-${{ hashFiles('local-server/yarn.lock') }}
key: ${{ runner.os }}_npm_modules_${{ hashFiles('local-server/yarn.lock') }}
- name: Install node dependencies
run: cd local-server && yarn install && yarn build && yarn copy-to-app
# See https://github.com/actions/runner-images/issues/10722#issuecomment-2387952421
Expand All @@ -55,4 +55,4 @@ jobs:
uses: actions/cache/save@v4
with:
path: app/build/derived_data
key: ${{ runner.os }}-app-derived-data-main
key: ${{ runner.os }}_app_derived_data_main
111 changes: 78 additions & 33 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ on:
- 'docs/**'
- '**/*.md'
concurrency:
group: integration-tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
group: integration_tests_${{ github.ref }}
cancel_in_progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
detect-app-changes:
detect_changes:
runs-on: ubuntu-latest
outputs:
app: ${{ steps.filter.outputs.app }}
xcode_config: ${{ steps.filter.outputs.xcode_config }}
app_tools: ${{ steps.filter.outputs.app_tools }}
local_server: ${{ steps.filter.outputs.local_server }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
Expand All @@ -22,11 +25,18 @@ jobs:
filters: |
app:
- 'app/**'
build-release-app:
xcode_config:
- 'app/**/*.xcconfig'
- 'app/**/*.xcodeproj/**'
app_tools:
- 'app/tools/**'
local_server:
- 'local-server/**'
build_release_app:
runs-on: macos-26
timeout-minutes: 60
needs: detect-app-changes
if: ${{ needs.detect-app-changes.outputs.app == 'true' }}
needs: detect_changes
if: ${{ needs.detect_changes.outputs.app == 'true' }}
steps:
- name: MacOS version
run: sw_vers
Expand All @@ -45,7 +55,7 @@ jobs:
uses: actions/cache@v4
with:
path: local-server/node_modules
key: ${{ runner.os }}-npm-modules-${{ hashFiles('local-server/yarn.lock') }}
key: ${{ runner.os }}_npm_modules_${{ hashFiles('local-server/yarn.lock') }}
- name: Install node dependencies
run: cd local-server && yarn install && yarn build && yarn copy-to-app
# See https://github.com/actions/runner-images/issues/10722#issuecomment-2387952421
Expand All @@ -55,15 +65,17 @@ jobs:
username: oauth2
password: ${{ secrets.GITHUB_TOKEN }}
- name: Load derived data & SPM cache
uses: actions/cache/restore@v4
uses: actions/cache@v4
with:
path:
app/build/derived_data
app/modules/.build
~/Library/Caches/org.swift.swiftpm
~/Library/org.swift.swiftpm
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
key: ${{ runner.os }}-app-derived-data-main
key: ${{ runner.os }}_app_derived_data_${{ hashFiles('app/modules/Package.swift', 'app/modules/Package.resolved') }}
restore-keys: |
${{ runner.os }}_app_derived_data_
- name: Install fastlane dependencies
run: |
cd app/fastlane && gem install bundler && bundle install
Expand All @@ -87,11 +99,11 @@ jobs:
exit 1
fi

test-swift:
test_swift_app:
runs-on: macos-26
timeout-minutes: 60
needs: detect-app-changes
if: ${{ needs.detect-app-changes.outputs.app == 'true' }}
needs: detect_changes
if: ${{ needs.detect_changes.outputs.app == 'true' }}
steps:
- name: MacOS version
run: sw_vers
Expand All @@ -110,7 +122,7 @@ jobs:
uses: actions/cache@v4
with:
path: local-server/node_modules
key: ${{ runner.os }}-npm-modules-${{ hashFiles('local-server/yarn.lock') }}
key: ${{ runner.os }}_npm_modules_${{ hashFiles('local-server/yarn.lock') }}
- name: Install dependencies
run: cd local-server && yarn install && yarn build && yarn copy-to-app
- name: Load SPM cache
Expand All @@ -121,23 +133,50 @@ jobs:
~/Library/Caches/org.swift.swiftpm
~/Library/org.swift.swiftpm
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
key: ${{ runner.os }}-spm-app-modules-${{ hashFiles('app/modules/Package.swift') }}
key: ${{ runner.os }}_spm_app_modules_${{ hashFiles('app/modules/Package.swift', 'app/modules/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-app-modules-
- name: Run tests
${{ runner.os }}_spm_app_modules_
- name: Run app module tests
run: ./cmd.sh test:swift

lint-swift:
test_app_tools:
runs-on: macos-26
timeout-minutes: 60
needs: detect_changes
if: ${{ needs.detect_changes.outputs.app_tools == 'true' }}
steps:
- name: MacOS version
run: sw_vers
- uses: actions/checkout@v4
- uses: gsabran/setup-swift@main
with:
swift-version: "6.2"
soft-fail-version-check: true
- name: Load SPM cache
uses: actions/cache@v4
with:
path:
app/tools/dependencies/.build
~/Library/Caches/org.swift.swiftpm
~/Library/org.swift.swiftpm
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
key: ${{ runner.os }}_spm_dependencies_tool_${{ hashFiles('app/tools/dependencies/Package.swift') }}
restore-keys: |
${{ runner.os }}_spm_dependencies_tool_
- name: Run app tools tests
run: cd app/tools/dependencies && swift test

lint_swift:
runs-on: macos-26
timeout-minutes: 60
needs: detect-app-changes
if: ${{ needs.detect-app-changes.outputs.app == 'true' }}
needs: detect_changes
if: ${{ needs.detect_changes.outputs.app == 'true' }}
steps:
- name: MacOS version
run: sw_vers
- uses: actions/checkout@v4
- name: Set up Homebrew
id: set-up-homebrew
id: set_up_homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install swiftformat
run: brew install swiftformat
Expand All @@ -146,11 +185,11 @@ jobs:
- name: Verify that `cmd lint:swift` did not change outputs (if it did, please re-run it and re-commit!)
run: git diff --exit-code

sync-app-dependencies:
sync_app_dependencies:
runs-on: macos-26
timeout-minutes: 60
needs: detect-app-changes
if: ${{ needs.detect-app-changes.outputs.app == 'true' }}
needs: detect_changes
if: ${{ needs.detect_changes.outputs.app == 'true' }}
steps:
- name: MacOS version
run: sw_vers
Expand All @@ -160,23 +199,25 @@ jobs:
swift-version: "6.2"
soft-fail-version-check: true
- name: Set up Homebrew
id: set-up-homebrew
id: set_up_homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install swiftformat
run: brew install swiftformat
- name: Cache dependencies binary
uses: actions/cache@v4
with:
path: app/tools/dependencies/tmp/bin
key: ${{ runner.os }}-spm-tools-${{ hashFiles('app/tools/dependencies/**') }}
key: ${{ runner.os }}_spm_tools_${{ hashFiles('app/tools/dependencies/**') }}
- name: Run sync dependencies
run: ./cmd.sh sync:dependencies
- name: Verify that `cmd sync:dependencies` did not change outputs (if it did, please re-run it and re-commit!)
run: git diff --exit-code

test-node:
test_node:
runs-on: macos-26
timeout-minutes: 60
needs: detect_changes
if: ${{ needs.detect_changes.outputs.local_server == 'true' }}
steps:
- name: MacOS version
run: sw_vers
Expand All @@ -188,7 +229,7 @@ jobs:
uses: actions/cache@v4
with:
path: local-server/node_modules
key: ${{ runner.os }}-npm-modules-${{ hashFiles('local-server/yarn.lock') }}
key: ${{ runner.os }}_npm_modules_${{ hashFiles('local-server/yarn.lock') }}
- name: Install dependencies
run: cd local-server && yarn install
- name: Run tests
Expand All @@ -197,6 +238,8 @@ jobs:
tsc:
runs-on: macos-26
timeout-minutes: 60
needs: detect_changes
if: ${{ needs.detect_changes.outputs.local_server == 'true' }}
steps:
- name: MacOS version
run: sw_vers
Expand All @@ -208,15 +251,17 @@ jobs:
uses: actions/cache@v4
with:
path: local-server/node_modules
key: ${{ runner.os }}-npm-modules-${{ hashFiles('local-server/yarn.lock') }}
key: ${{ runner.os }}_npm_modules_${{ hashFiles('local-server/yarn.lock') }}
- name: Install dependencies
run: cd local-server && yarn install
- name: Run tests
run: cd local-server && yarn tsc

lint-node:
lint_node:
runs-on: macos-26
timeout-minutes: 60
needs: detect_changes
if: ${{ needs.detect_changes.outputs.local_server == 'true' }}
steps:
- name: MacOS version
run: sw_vers
Expand All @@ -228,23 +273,23 @@ jobs:
uses: actions/cache@v4
with:
path: local-server/node_modules
key: ${{ runner.os }}-npm-modules-${{ hashFiles('local-server/yarn.lock') }}
key: ${{ runner.os }}_npm_modules_${{ hashFiles('local-server/yarn.lock') }}
- name: Install dependencies
run: cd local-server && yarn install
- name: Run linter
run: ./cmd.sh lint:ts
- name: Verify that `cmd lint:ts` did not change outputs (if it did, please re-run it and re-commit!)
run: git diff --exit-code

lint-shell:
lint_shell:
runs-on: macos-26
timeout-minutes: 60
steps:
- name: MacOS version
run: sw_vers
- uses: actions/checkout@v4
- name: Set up Homebrew
id: set-up-homebrew
id: set_up_homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install shfmt
run: brew install shfmt
Expand All @@ -253,7 +298,7 @@ jobs:
- name: Verify that `cmd lint:shell` did not change outputs (if it did, please re-run it and re-commit!)
run: git diff --exit-code

lint-ruby:
lint_ruby:
runs-on: macos-26
timeout-minutes: 60
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
pull_requests: write
jobs:
distribute-app:
distribute_app:
runs-on: macos-26
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: MacOS version
run: sw_vers
- name: Set up Homebrew
id: set-up-homebrew
id: set_up_homebrew
uses: Homebrew/actions/setup-homebrew@master
- uses: gsabran/setup-swift@main
with:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: app/build/derived_data
key: ${{ runner.os }}-app-derived-data-main
key: ${{ runner.os }}_app_derived_data_main
- name: Publish release
run: cd app/fastlane && bundle exec fastlane mac distribute_release
env:
Expand Down
1 change: 0 additions & 1 deletion app/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ platform :mac do
setup_ci if ENV["CI"]

build_path = File.absolute_path("../build")
sh("rm -rf #{build_path}")

# Resolve package dependencies first. This is to work around an issue where CI would freeze.
sh("xcodebuild -resolvePackageDependencies -scheme command -project ../command.xcodeproj -configuration Release -derivedDataPath #{build_path}/derived_data -onlyUsePackageVersionsFromResolvedFile -parallelizeTargets")
Expand Down
3 changes: 1 addition & 2 deletions cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ test_swift_command() {
cd "$(dirname $package_swift)" && swift test -Xswiftc -suppress-warnings --quiet --no-parallel "${parsed_args[@]}"
else
# run all tests
cd "$(git rev-parse --show-toplevel)/app/modules" && swift test -Xswiftc -suppress-warnings --quiet --no-parallel "${parsed_args[@]}" || exit 1
cd "$(git rev-parse --show-toplevel)/app/tools/dependencies" && swift test "${parsed_args[@]}" || exit 1
cd "$(git rev-parse --show-toplevel)/app/modules" && swift test -Xswiftc -suppress-warnings --quiet --no-parallel "${parsed_args[@]}"
fi
}

Expand Down