From d971164923ab90705ef425ff2e790d9452c26c0f Mon Sep 17 00:00:00 2001 From: Adam Crownoble Date: Wed, 15 Jul 2026 18:02:25 -0500 Subject: [PATCH 1/3] Replace Jenkins and Travis CI with GitHub Actions This brings the previous Travis CI and Jenkins CI jobs over into GitHub Actions as that's the direction we're going these days. I've disabled the RubyGems publish for now as we work out the permissions there. In the meantime, it can be handled manually. --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++ .travis.yml | 20 ------------- Jenkinsfile | 61 ---------------------------------------- 3 files changed, 55 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100755 Jenkinsfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9b33279 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + push: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build image + run: docker compose build --pull + + - name: Lint (RuboCop) + run: docker compose run --rm api_client_builder bundle exec rubocop + + # Named container (not --rm) so coverage can be copied out afterwards. + # SimpleCov enforces its 97% minimum in-container and fails the build below. + - name: Spec + run: docker compose run --name acb_spec api_client_builder bundle exec rspec --format doc + + - name: Export coverage report + if: always() + continue-on-error: true + run: docker cp acb_spec:/usr/src/app/coverage ./coverage + + - name: Upload coverage artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage/ + if-no-files-found: ignore + + # DISABLED — brought over from the Jenkins pipeline but will not run yet. + # To enable auto-publishing to RubyGems on merge to master: + # 1. Add a `RUBYGEMS_API_KEY` repository secret (the RubyGems "rubygems-rw" API key). + # 2. Replace the `if: false` below with: if: github.ref == 'refs/heads/master' + publish: + needs: test + runs-on: ubuntu-latest + if: false + steps: + - uses: actions/checkout@v4 + + - name: Build image + run: docker compose build --pull + + - name: Publish gem to RubyGems + env: + GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} + run: docker compose run -e GEM_HOST_API_KEY --rm api_client_builder /bin/bash -lc "./bin/publish.sh" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 37422cc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -dist: trusty -sudo: false -language: ruby -cache: bundler - -rvm: - - 2.3 - - 2.4 - - 2.5 - -matrix: - fast_finish: true - -before_install: gem update bundler -bundler_args: --jobs 3 -install: bundle install --jobs 3 - -script: - - bundle exec rubocop --fail-level autocorrect - - bundle exec rspec diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100755 index cb9c124..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,61 +0,0 @@ -pipeline { - agent { - label 'docker' - } - - options { - parallelsAlwaysFailFast() - } - - stages { - stage('Build') { - steps { - sh 'docker compose build --pull' - } - } - - stage('Spec') { - steps { - sh 'docker compose run api_client_builder bundle exec rspec --format doc' - sh ''' - image=$(docker ps --all --no-trunc | grep spec | cut -f 1 -d " " | head -n 1) - docker cp "$image:/usr/src/app/coverage" . - ''' - sh 'ls -als coverage' - } - - post { - always { - publishHTML target: [ - allowMissing: false, - alwaysLinkToLastBuild: false, - keepAll: true, - reportDir: 'coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report' - ] - } - } - } - - stage('Publish') { - when { - allOf { - expression { GERRIT_BRANCH == 'master' } - environment name: 'GERRIT_EVENT_TYPE', value: 'change-merged' - } - } - steps { - withCredentials([string(credentialsId: 'rubygems-rw', variable: 'GEM_HOST_API_KEY')]) { - sh 'docker compose run -e GEM_HOST_API_KEY --rm api_client_builder /bin/bash -lc "./bin/publish.sh"' - } - } - } - } - - post { - cleanup { - sh 'docker compose down --rmi=all --volumes --remove-orphans' - } - } -} From 92e94022f88a46c9e1e4865a46324757e9652a26 Mon Sep 17 00:00:00 2001 From: Adam Crownoble Date: Fri, 17 Jul 2026 15:46:23 -0500 Subject: [PATCH 2/3] Upgrade to latest checkout action version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b33279..d99e929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build image run: docker compose build --pull @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest if: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build image run: docker compose build --pull From 63cb30d3f9e04627dd5fb5fb982e7f8f4a50646b Mon Sep 17 00:00:00 2001 From: Adam Crownoble Date: Fri, 17 Jul 2026 16:17:25 -0500 Subject: [PATCH 3/3] Make Rubocop Ruby version equal to .gemspec This fixes a failing cop --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8fa6435..e911d65 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,5 @@ AllCops: - TargetRubyVersion: 3.4 + TargetRubyVersion: 3.0 Metrics/BlockLength: Exclude: