From 0054fbd5bfc4dfd1b1df37b2d63cb8f5b8e993d3 Mon Sep 17 00:00:00 2001 From: David T Harris Date: Wed, 21 Feb 2024 11:00:05 -0500 Subject: [PATCH] 2813587 Replace CircleCI with GitHub Actions --- .github/workflows/ci.yml | 57 ------------------------- .github/workflows/test_and_build.yml | 63 ++++++++++++++++++++++++++++ Gemfile.lock | 1 + 3 files changed, 64 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/test_and_build.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index ce4c592..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: ci - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - ruby: 1.9.3 - rubygems: 2.7.8 - - ruby: 2.0.0 - rubygems: 2.7.8 - - ruby: 2.1.10 - rubygems: 2.7.8 - - ruby: 2.2.7 - rubygems: 2.7.8 - - ruby: 2.3.4 - - ruby: 2.4.1 - - ruby: 2.5.1 - - ruby: 2.6.0 - - ruby: ruby-head - - ruby: jruby-d19 - - ruby: jruby-9.1.9.0 - - ruby: jruby-head - steps: - - uses: actions/checkout@v2 - - name: Install rvm - run: | - curl -sSL https://get.rvm.io | bash - - name: Install ruby - run: | - source $HOME/.rvm/scripts/rvm - rvm use ${{ matrix.ruby }} --default --install --binary --fuzzy --create - - name: Check ruby version - run: | - source $HOME/.rvm/scripts/rvm - ruby --version - - name: Update rubygems - run: | - source $HOME/.rvm/scripts/rvm - gem update --system ${{ matrix.rubygems }} - - name: Install bundler - run: | - source $HOME/.rvm/scripts/rvm - gem install bundler --no-document -v '~> 1.13' - - name: Install gems - run: | - source $HOME/.rvm/scripts/rvm - bundle install --jobs 4 - - run: unset JRUBY_OPTS - - name: Run rake - run: | - source $HOME/.rvm/scripts/rvm - bundle exec rake diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml new file mode 100644 index 0000000..ff7e5c9 --- /dev/null +++ b/.github/workflows/test_and_build.yml @@ -0,0 +1,63 @@ +name: Test and Build +on: push + +jobs: + verify_gemfile_lock: + runs-on: ubuntu-latest + env: + BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - name: setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.3 + bundler-cache: true # runs 'bundle install' and caches installed gems + - name: bundler + shell: bash + run: |- + gem install bundler -v $(grep 'BUNDLED WITH' Gemfile.lock -A 1|tail -1) + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + - name: Verify Gemfile.lock + shell: bash + run: |- + if git diff-index --quiet HEAD -- Gemfile.lock + then + exit 0 + else + echo "Please ensure that you have bundled and committed any" + echo "resulting changes to the Gemfile.lock file in this repo." + git --no-pager diff -- Gemfile.lock + exit 128 + fi + + test_and_build: + runs-on: ubuntu-latest + env: + BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + + - name: setup ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: bundler + shell: bash + run: |- + gem install bundler -v $(grep 'BUNDLED WITH' Gemfile.lock -A 1|tail -1) + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + + - name: specs + shell: bash + run: |- + # Run specs to ensure build is passing + bundle exec rake test + + # Run rake build to ensure gem will build + bundle exec rake build diff --git a/Gemfile.lock b/Gemfile.lock index d03db05..1c83aed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,7 @@ GEM PLATFORMS arm64-darwin-21 + x86_64-linux DEPENDENCIES benchmark-ips