-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from SwiftGen/feature/circleci-2
Migrate to CircleCI 2.0
- Loading branch information
Showing
4 changed files
with
128 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
defaults: | ||
- &default-config | ||
parallelism: 1 | ||
environment: | ||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts | ||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results | ||
BUNDLE_PATH: vendor/bundle | ||
macos: | ||
xcode: "8.3.3" | ||
shell: /bin/bash --login -eo pipefail | ||
- &prepare-storage | ||
run: | ||
name: Create directories for artifacts and reports | ||
command: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS | ||
- &restore-gems | ||
restore_cache: | ||
keys: | ||
- gems-{{ checksum "Gemfile.lock" }} | ||
- gems- | ||
- &install-gems | ||
run: | ||
name: Bundle install | ||
command: bundle check || bundle install | ||
environment: | ||
BUNDLE_JOBS: 4 | ||
BUNDLE_RETRY: 3 | ||
- &store-gems | ||
save_cache: | ||
key: v1-gems-{{ checksum "Gemfile.lock" }} | ||
paths: | ||
- vendor/bundle | ||
- &fetch-xcode-logs | ||
run: | ||
name: Getting Xcode activity logs | ||
command: find $HOME/Library/Developer/Xcode/DerivedData -name '*.xcactivitylog' -exec cp {} $CIRCLE_ARTIFACTS/xcactivitylog \; || true | ||
- &store-artifacts | ||
store_artifacts: | ||
path: /tmp/circleci-artifacts | ||
|
||
|
||
version: 2 | ||
jobs: | ||
lint: | ||
<<: *default-config | ||
steps: | ||
- *prepare-storage | ||
- checkout | ||
- *restore-gems | ||
- *install-gems | ||
- *store-gems | ||
- run: | ||
name: Lint source code | ||
command: bundle exec rake lint:code | ||
- run: | ||
name: Lint tests source code | ||
command: bundle exec rake lint:tests | ||
- *store-artifacts | ||
|
||
xcode-build-and-test: | ||
<<: *default-config | ||
steps: | ||
- *prepare-storage | ||
- checkout | ||
- *restore-gems | ||
- *install-gems | ||
- *store-gems | ||
- run: | ||
name: Run all tests | ||
command: bundle exec rake xcode:test | ||
- store_test_results: | ||
path: /tmp/circleci-test-results | ||
- *fetch-xcode-logs | ||
- *store-artifacts | ||
|
||
spm-build-and-test: | ||
<<: *default-config | ||
steps: | ||
- *prepare-storage | ||
- checkout | ||
- *restore-gems | ||
- *install-gems | ||
- *store-gems | ||
- run: | ||
name: Run all tests | ||
command: bundle exec rake spm:test | ||
- *store-artifacts | ||
|
||
check-deploy: | ||
<<: *default-config | ||
steps: | ||
- *prepare-storage | ||
- checkout | ||
- *restore-gems | ||
- *install-gems | ||
- *store-gems | ||
- run: | ||
name: Download podspec repo | ||
command: curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf | ||
- run: | ||
name: Lint podspec | ||
command: bundle exec rake pod:lint | ||
- *store-artifacts | ||
|
||
|
||
workflows: | ||
version: 2 | ||
lint-buildandtest-checkdeploy: | ||
jobs: | ||
- lint | ||
- spm-build-and-test | ||
- xcode-build-and-test | ||
- check-deploy: | ||
requires: | ||
- lint | ||
- spm-build-and-test | ||
- xcode-build-and-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby-2.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters