Skip to content

Commit

Permalink
trying workspaces to save build times
Browse files Browse the repository at this point in the history
  • Loading branch information
msadoon committed May 11, 2023
1 parent 47044a4 commit 767f036
Showing 1 changed file with 27 additions and 68 deletions.
95 changes: 27 additions & 68 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,12 @@ base_job: &base_job

test_job: &test_job
steps:
- checkout
- run:
name: SPM SSH Workaround
command: *spm_ssh_workaround
- run:
name: Store Xcode Version
command: xcodebuild -version > xcode_version.txt
- restore_cache:
name: Restore SPM Cache
keys:
- spm-cache-v1-{{ checksum "./Kickstarter.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved" }}-{{ checksum "xcode_version.txt" }}
- run:
name: Bootstrap SPM
command: xcodebuild -resolvePackageDependencies -clonedSourcePackagesDirPath SourcePackages
- run:
name: Bootstrap
command: make bootstrap
- run:
name: Download GraphQL Schema
command: bin/apollo-schema-download.sh
- run:
name: Pre-install simulator
command: xcrun simctl create "iPhone 8 (15.5)" com.apple.CoreSimulator.SimDeviceType.iPhone-8 com.apple.CoreSimulator.SimRuntime.iOS-15-5
- run:
name: Pre-load simulator
command: *preload_simulator
- attach_workspace:
at: ksr_ios_workspace
- run:
name: Run tests
command: make test
no_output_timeout: "20m" # 20 minutes
- restore_cache:
name: Restore Bundler
keys:
- v1-gems-{{ checksum "Gemfile.lock" }}
- run:
name: Install Bundler
command: bundle check || bundle install
environment:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
- run:
name: Generate Slather coverage report
command: bundle exec slather coverage -x --scheme $SCHEME ./Kickstarter.xcodeproj
Expand All @@ -82,38 +48,10 @@ test_job: &test_job

distribute_job: &distribute_job
steps:
- checkout
- attach_workspace:
at: ksr_ios_workspace
- aws-cli/setup:
<<: *aws_cli_setup
- run:
name: SPM SSH Workaround
command: *spm_ssh_workaround
- run:
name: Store Xcode Version
command: xcodebuild -version > xcode_version.txt
- restore_cache:
name: Restore SPM Cache
keys:
- spm-cache-v1-{{ checksum "./Kickstarter.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved" }}-{{ checksum "xcode_version.txt" }}
- run:
name: Bootstrap SPM
command: xcodebuild -resolvePackageDependencies -clonedSourcePackagesDirPath SourcePackages
- run:
name: Bootstrap
command: make bootstrap
- restore_cache:
keys:
- v1-gems-{{ checksum "Gemfile.lock" }}
- run:
name: Bundle install
command: bundle check || bundle install
environment:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
- save_cache:
key: v1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Increment build number
command: agvtool new-version -all $(($(date +%s)/1000))
Expand All @@ -136,10 +74,15 @@ distribute_job: &distribute_job
path: output

all_jobs: &all_jobs
- build-and-cache
- kickstarter-tests
requires:
- build-and-cache
- library-tests
requires:
- build-and-cache
- ksapi-tests
requires:
- build-and-cache

# Jobs

Expand Down Expand Up @@ -171,6 +114,15 @@ jobs:
key: spm-cache-v1-{{ checksum "./Kickstarter.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved" }}-{{ checksum "xcode_version.txt" }}
paths:
- SourcePackages
- run:
name: Download GraphQL Schema
command: bin/apollo-schema-download.sh
- run:
name: Pre-install simulator
command: xcrun simctl create "iPhone 8 (15.5)" com.apple.CoreSimulator.SimDeviceType.iPhone-8 com.apple.CoreSimulator.SimRuntime.iOS-15-5
- run:
name: Pre-load simulator
command: *preload_simulator
- restore_cache:
name: Restore Bundler
keys:
Expand All @@ -189,6 +141,8 @@ jobs:
- run:
name: Danger
command: bin/danger.sh
- persist_to_workspace:
root: ksr_ios_workspace

# Kickstarter tests
kickstarter-tests:
Expand Down Expand Up @@ -301,10 +255,15 @@ workflows:
build:
# Matches all_jobs
jobs:
- build-and-cache
- kickstarter-tests
requires:
- build-and-cache
- library-tests
requires:
- build-and-cache
- ksapi-tests
requires:
- build-and-cache
# ** Refreshing dSYMs disabled until a suitable workaround is found for App Store Connect 2FA authentication
# or Fastlane implements API key support in this Fastlane action. Uncomment below to re-enable.
# See: https://docs.fastlane.tools/app-store-connect-api/
Expand Down

0 comments on commit 767f036

Please sign in to comment.