update gemspec and lock file #141
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| workflow_dispatch: | |
| # Cancel previous workflows on previous push | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| # Global environment variables | |
| env: | |
| RUBY_VERSION: '3.3' | |
| BUNDLER_VERSION: '2.7' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| SQUARE_SANDBOX_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }} | |
| strategy: | |
| matrix: | |
| ruby-version: ['3.2', '3.3', '3.4'] | |
| bundler-version: ['2.7'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| - name: Install dependencies | |
| run: | | |
| bundle install | |
| - name: Build gem | |
| run: | | |
| bundle exec rake build | |
| - name: Run tests | |
| run: | | |
| bundle exec rake test | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ env.RUBY_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| bundle install | |
| # - name: Run RuboCop with auto-correct | |
| # run: | | |
| # bundle exec rake rubocop:autocorrect | |
| # TODO: Uncomment this when we have a way a fix for all RuboCop violations | |
| # - name: Check for RuboCop violations | |
| # run: | | |
| # bundle exec rubocop --fail-level W | |
| # - name: Ensure no changes to git-tracked files | |
| # run: git --no-pager diff --exit-code | |
| gem-publish: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ env.RUBY_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| bundle install | |
| - name: Build gem | |
| run: | | |
| bundle exec rake build | |
| - name: Publish to RubyGems | |
| run: | | |
| gem push pkg/*.gem --host https://rubygems.org/ | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} |