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..5cd36e5 --- /dev/null +++ b/.github/workflows/test_and_build.yml @@ -0,0 +1,64 @@ +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: ${{ env.RUBY_VERSION }} + 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