diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..ffd9bf3b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,241 @@ +# DO NOT MODIFY - this is managed by Git Reduce in goro and generated from build-matrix.json +# +--- +version: 2.1 + +############ +## Github Actions Pipeline Params +############ + +parameters: + GHA_Event: + type: string + default: "" + GHA_Actor: + type: string + default: "" + GHA_Action: + type: string + default: "" + GHA_Meta: + type: string + default: "" + +jobs: + generate-and-push-docs: + docker: + - image: cimg/ruby:3.4.5 + auth: + username: "$DOCKERHUB_USERNAME" + password: "$DOCKERHUB_PASSWORD" + steps: + - checkout + - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN + - run: bundle install + - run: + name: Generate documentation + command: ' if [[ $(bundle exec rake -T docs:generate:custom) ]]; then echo + "Generating docs using rake task docs:generate:custom" ; bundle exec rake + docs:generate:custom ; elif [[ $(bundle exec rake -T docs:generate) ]]; + then echo "Generating docs using rake task docs:generate" ; bundle exec + rake docs:generate ; else echo "Skipping doc generation" ; exit 0 ; fi ' + - run: + name: Push documentation to Unwritten + command: if [[ $(bundle exec rake -T docs:push) ]]; then bundle exec rake + docs:push; fi + release: + docker: + - image: cimg/ruby:3.4.5 + auth: + username: "$DOCKERHUB_USERNAME" + password: "$DOCKERHUB_PASSWORD" + steps: + - checkout + - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN + - run: bundle install + - run: + name: Artifactory login + command: mkdir -p ~/.gem && curl -u$ARTIFACTORY_USER:$ARTIFACTORY_TOKEN https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/api/v1/api_key.yaml + > ~/.gem/credentials && chmod 0600 ~/.gem/credentials + - run: + name: Build/release gem to artifactory + command: bundle exec rake push_artifactory + ruby-3_4_5-rails-8_0: + docker: + - image: cimg/ruby:3.4.5 + auth: + username: "$DOCKERHUB_USERNAME" + password: "$DOCKERHUB_PASSWORD" + environment: + BUNDLE_GEMFILE: Gemfile.rails-8.0 + working_directory: "~/rspec_api_documentation" + steps: + - checkout + - run: + name: Check for Gemfile.lock presence + command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see + https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)" + 1>&2 ; exit 1 ; else exit 0 ; fi ' + - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN + - run: bundle install + - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml + --format=doc + - run: + name: Run Additional CI Steps + command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps; + fi + - run: + name: Notify Pager Duty + command: bundle exec y-notify "#app-platform-ops" + when: on_fail + - store_test_results: + path: "/tmp/test-results" + ruby-3_3_9-rails-8_0: + docker: + - image: cimg/ruby:3.3.9 + auth: + username: "$DOCKERHUB_USERNAME" + password: "$DOCKERHUB_PASSWORD" + environment: + BUNDLE_GEMFILE: Gemfile.rails-8.0 + working_directory: "~/rspec_api_documentation" + steps: + - checkout + - run: + name: Check for Gemfile.lock presence + command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see + https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)" + 1>&2 ; exit 1 ; else exit 0 ; fi ' + - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN + - run: bundle install + - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml + --format=doc + - run: + name: Run Additional CI Steps + command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps; + fi + - run: + name: Notify Pager Duty + command: bundle exec y-notify "#app-platform-ops" + when: on_fail + - store_test_results: + path: "/tmp/test-results" + ruby-3_4_5-rails-7_2: + docker: + - image: cimg/ruby:3.4.5 + auth: + username: "$DOCKERHUB_USERNAME" + password: "$DOCKERHUB_PASSWORD" + environment: + BUNDLE_GEMFILE: Gemfile.rails-7.2 + working_directory: "~/rspec_api_documentation" + steps: + - checkout + - run: + name: Check for Gemfile.lock presence + command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see + https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)" + 1>&2 ; exit 1 ; else exit 0 ; fi ' + - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN + - run: bundle install + - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml + --format=doc + - run: + name: Run Additional CI Steps + command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps; + fi + - run: + name: Notify Pager Duty + command: bundle exec y-notify "#app-platform-ops" + when: on_fail + - store_test_results: + path: "/tmp/test-results" + ruby-3_3_9-rails-7_2: + docker: + - image: cimg/ruby:3.3.9 + auth: + username: "$DOCKERHUB_USERNAME" + password: "$DOCKERHUB_PASSWORD" + environment: + BUNDLE_GEMFILE: Gemfile.rails-7.2 + working_directory: "~/rspec_api_documentation" + steps: + - checkout + - run: + name: Check for Gemfile.lock presence + command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see + https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)" + 1>&2 ; exit 1 ; else exit 0 ; fi ' + - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN + - run: bundle install + - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml + --format=doc + - run: + name: Run Additional CI Steps + command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps; + fi + - run: + name: Notify Pager Duty + command: bundle exec y-notify "#app-platform-ops" + when: on_fail + - store_test_results: + path: "/tmp/test-results" +workflows: + version: 2 + on-commit: + unless: + equal: [ "schedule", << pipeline.parameters.GHA_Event >> ] + jobs: + - release: + context: org-global + requires: + - ruby-3_4_5-rails-8_0 + - ruby-3_3_9-rails-8_0 + - ruby-3_4_5-rails-7_2 + - ruby-3_3_9-rails-7_2 + filters: + tags: + only: "/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:(-|\\.)(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/" + branches: + ignore: /.*/ + - generate-and-push-docs: + context: org-global + requires: + - release + filters: + tags: + only: "/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:(-|\\.)(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/" + branches: + ignore: /.*/ + - ruby-3_4_5-rails-8_0: + context: org-global + filters: + tags: + only: &1 /.*/ + - ruby-3_3_9-rails-8_0: + context: org-global + filters: + tags: + only: *1 + - ruby-3_4_5-rails-7_2: + context: org-global + filters: + tags: + only: *1 + - ruby-3_3_9-rails-7_2: + context: org-global + filters: + tags: + only: *1 + scheduled: + when: + equal: [ "schedule", << pipeline.parameters.GHA_Event >> ] + jobs: + - ruby-3_4_5-rails-8_0: + context: org-global + - ruby-3_3_9-rails-8_0: + context: org-global + - ruby-3_4_5-rails-7_2: + context: org-global + - ruby-3_3_9-rails-7_2: + context: org-global diff --git a/.github/workflows/scheduled_cci.yml b/.github/workflows/scheduled_cci.yml new file mode 100644 index 00000000..a094fc88 --- /dev/null +++ b/.github/workflows/scheduled_cci.yml @@ -0,0 +1,14 @@ +on: + schedule: + - cron: '53 20 * * 1,2,3,4,5' + workflow_dispatch: + +jobs: + trigger-circleci: + runs-on: ubuntu-latest + steps: + - name: CircleCI trigger on schedule + id: step1 + uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5 + env: + CCI_TOKEN: ${{ secrets.CCI_TOKEN || secrets.CCI_TOKEN_FOR_PUBLIC_REPOS }} diff --git a/Gemfile.rails-7.2 b/Gemfile.rails-7.2 new file mode 100644 index 00000000..627fa870 --- /dev/null +++ b/Gemfile.rails-7.2 @@ -0,0 +1,7 @@ +# DO NOT MODIFY - this is managed by Git Reduce in goro +# +source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/' + +gemspec + +gem 'activesupport', '~> 7.2.0' diff --git a/Gemfile.rails-8.0 b/Gemfile.rails-8.0 new file mode 100644 index 00000000..9cb08fb3 --- /dev/null +++ b/Gemfile.rails-8.0 @@ -0,0 +1,7 @@ +# DO NOT MODIFY - this is managed by Git Reduce in goro +# +source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/' + +gemspec + +gem 'activesupport', '~> 8.0.0' diff --git a/build-matrix.json b/build-matrix.json new file mode 100644 index 00000000..15010237 --- /dev/null +++ b/build-matrix.json @@ -0,0 +1,3 @@ +{ + "build_matrix": {} +} diff --git a/rspec_api_documentation.gemspec b/rspec_api_documentation.gemspec index 20e1258d..d07b6ee9 100644 --- a/rspec_api_documentation.gemspec +++ b/rspec_api_documentation.gemspec @@ -40,4 +40,5 @@ Gem::Specification.new do |s| s.files = Dir.glob("lib/**/*") + Dir.glob("templates/**/*") s.require_path = "lib" + s.add_development_dependency('rspec_junit_formatter') end