-
Notifications
You must be signed in to change notification settings - Fork 9
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 #10 from doximity/setup-ci
Setup CI and Gem Publishing + better form validation
- Loading branch information
Showing
18 changed files
with
351 additions
and
85 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,123 @@ | ||
--- | ||
|
||
version: 2.1 | ||
|
||
orbs: | ||
gem: doximity/gem-publisher@0 | ||
|
||
executors: | ||
ruby-latest: | ||
resource_class: small | ||
docker: | ||
- image: circleci/ruby:2.7.2 | ||
environment: | ||
BUNDLE_VERSION: "~> 2.2.8" | ||
|
||
# yaml anchor filters | ||
master_only: &master_only | ||
filters: | ||
branches: | ||
only: master | ||
tags: | ||
ignore: /.*/ | ||
pr_only: &pr_only | ||
filters: | ||
branches: | ||
ignore: master | ||
tags: | ||
ignore: /.*/ | ||
version_tags_only: &version_tags_only | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ | ||
|
||
jobs: | ||
build: | ||
executor: ruby-latest | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Bundler specific version | ||
command: | | ||
gem install bundler --version "${BUNDLE_VERSION}" --force | ||
- restore_cache: | ||
keys: | ||
- v1-bundle-{{ checksum "Gemfile.lock" }}- | ||
- run: | ||
name: Install Bundler specific version | ||
command: | | ||
gem install bundler --version "~> 1.17" --force | ||
- run: | ||
name: Install Ruby Dependencies | ||
command: bundle check --path=vendor/bundle || bundle install | ||
- save_cache: | ||
key: v1-bundle-{{ checksum "Gemfile.lock" }}- | ||
paths: | ||
- vendor/bundle | ||
- run: | ||
name: Run Tests | ||
command: bundle exec rake test | ||
- store_test_results: | ||
name: Store test results | ||
path: tmp/test-results | ||
- run: | ||
name: Run StandardRB | ||
command: bundle exec standardrb | ||
- store_artifacts: | ||
name: Saves documentation | ||
path: doc | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- vendor/bundle | ||
|
||
workflows: | ||
version: 2 | ||
|
||
pull-requests: | ||
jobs: | ||
- build: | ||
<<: *pr_only | ||
- gem/build: | ||
executor: ruby-latest | ||
requires: | ||
- build | ||
- pre-release-approval: | ||
type: approval | ||
requires: | ||
- gem/build | ||
- gem/publish: | ||
to_nexus: true | ||
pre_release: true | ||
requires: | ||
- pre-release-approval | ||
context: artifact_publishing | ||
|
||
trunk: | ||
jobs: | ||
- build: | ||
<<: *master_only | ||
- gem/build: | ||
executor: ruby-latest | ||
requires: | ||
- build | ||
|
||
final-release: | ||
jobs: | ||
- build: | ||
<<: *version_tags_only | ||
- gem/build: | ||
<<: *version_tags_only | ||
executor: ruby-latest | ||
requires: | ||
- build | ||
- gem/publish: | ||
<<: *version_tags_only | ||
name: gem-publish | ||
to_rubygems: true | ||
pre_release: false | ||
requires: | ||
- gem/build | ||
context: artifact_publishing |
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
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
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
Oops, something went wrong.