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

Migrate to CircleCI 2.0 #81

Merged
merged 4 commits into from
Apr 9, 2018
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
116 changes: 116 additions & 0 deletions .circleci/config.yml
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
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.4.1
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ _None_
* Enabled some extra SwiftLint rules for better code consistency.
[David Jennes](https://github.com/djbe)
[#79](https://github.com/SwiftGen/StencilSwiftKit/pull/79)
* Migrated to CircleCI 2.0.
[David Jennes](https://github.com/djbe)
[#81](https://github.com/SwiftGen/StencilSwiftKit/pull/81)

## 2.4.0

Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
CFPropertyList (3.0.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
Expand Down Expand Up @@ -56,22 +56,22 @@ GEM
i18n (0.9.5)
concurrent-ruby (~> 1.0)
minitest (5.11.3)
molinillo (0.6.4)
molinillo (0.6.5)
multipart-post (2.0.0)
nanaimo (0.2.3)
nanaimo (0.2.4)
nap (1.1.0)
netrc (0.11.0)
octokit (4.8.0)
sawyer (~> 0.8.0, >= 0.5.3)
parallel (1.12.1)
parser (2.5.0.4)
parser (2.5.0.5)
ast (~> 2.4.0)
powerpack (0.1.1)
public_suffix (3.0.2)
rainbow (3.0.0)
rake (10.5.0)
rouge (2.0.7)
rubocop (0.53.0)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
Expand All @@ -87,12 +87,12 @@ GEM
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)
xcodeproj (1.5.6)
CFPropertyList (~> 2.3.3)
xcodeproj (1.5.7)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
nanaimo (~> 0.2.4)
xcpretty (0.2.8)
rouge (~> 2.0.7)

Expand Down