diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..4d34ca96 --- /dev/null +++ b/.circleci/config.yml @@ -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 diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..55bc9834 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-2.4.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 13bc4176..83b4cc13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 996b7a0b..2fa98833 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) @@ -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)