version: 2.1 orbs: ruby: circleci/ruby@2.1.0 executors: app-ruby: parameters: ruby-version: type: string default: '2.7' docker: - image: cimg/ruby:<> commands: run-tests: description: Run tests steps: - run: bundle exec rake test run-lint: description: Run standardrb lint check steps: - run: bundle exec rake standard run-docs-build: description: Generate docs steps: - run: bundle exec rake doc:build run-docs-publish: description: Update gh-pages steps: - run: | git checkout gh-pages cp -R doc/* . git commit -vam 'Update documentation' git push origin gh-pages jobs: test: parameters: ruby-version: type: string gemfile: type: string executor: name: app-ruby ruby-version: <> steps: - checkout - ruby/install-deps: gemfile: <> - run-tests # Convenience job for setting github branch protection rules test-matrix: executor: app-ruby steps: - checkout - run: echo "Done" lint: executor: app-ruby steps: - checkout - ruby/install-deps - run-lint build-docs: executor: app-ruby steps: - checkout - ruby/install-deps - run-docs-build - persist_to_workspace: root: . paths: doc publish-docs: executor: app-ruby steps: - checkout - ruby/install-deps - attach_workspace: at: . - add_ssh_keys: fingerprints: # ssh key generated solely for montrose docs - "97:43:0c:36:36:1d:83:30:f0:76:d4:9f:d3:71:a8:a5" - run: name: Configure git command: | git config user.email "ci-build@rossta.net" git config user.name "ci-build" - run-docs-publish release: executor: app-ruby steps: - checkout - ruby/install-deps - run: name: Publish gem to Rubygems command: bundle exec rake release workflows: build: jobs: - lint - build-docs - test-matrix: requires: - test - test: matrix: parameters: ruby-version: - '2.7' - '3.0' - '3.1' gemfile: - 'gemfiles/activesupport_5.2.gemfile' - 'gemfiles/activesupport_6.0.gemfile' - 'gemfiles/activesupport_6.1.gemfile' - 'gemfiles/activesupport_7.0.gemfile' - publish-docs: requires: - lint - build-docs - test-matrix filters: branches: only: main - release: requires: - test - lint filters: tags: only: /^v.*/ branches: ignore: /.*/