diff --git a/.circleci/config.yml b/.circleci/config.yml index 487c5024..87a50770 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,123 +1,12 @@ ---- - 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" +setup: true -# 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 +orbs: + pipefitter: doximity/pipefitter@0 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: + setup: 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 + - pipefitter/generate: context: artifact_publishing diff --git a/.circleci/pipefitter-config.yml b/.circleci/pipefitter-config.yml new file mode 100644 index 00000000..49d640b8 --- /dev/null +++ b/.circleci/pipefitter-config.yml @@ -0,0 +1,3 @@ +ruby-versions: ["supported-versions"] +run-matrix-separately: true +test-job-name: "build" diff --git a/.circleci/x_old.yml b/.circleci/x_old.yml new file mode 100644 index 00000000..487c5024 --- /dev/null +++ b/.circleci/x_old.yml @@ -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 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..023f32b2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,15 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. + +# These owners will be the default owners for everything in the repo. +# * @username + +# Order is important. The last matching pattern has the most precedence. +# So if a pull request only touches javascript files, only these owners +# will be requested to review. + +# Primary repo owners + +# Infra Automation +/.circleci @doximity/infra_automation_reviewers +/.github/workflows @doximity/infra_automation_reviewers