Skip to content

Commit

Permalink
Update CI configuration and test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Envek committed Jun 19, 2024
1 parent 2944dab commit 1dcad66
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 33 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
pull_request:
push:
branches:
- '**'
tags-ignore:
- 'v*'

jobs:
rubocop:
# Skip running tests for local pull requests (use push event instead), run only for foreign ones
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Lint Ruby code with RuboCop
run: |
bundle exec rubocop
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.3"
- name: "Extract data from tag: version, message, body"
id: tag
run: |
Expand Down Expand Up @@ -75,8 +79,8 @@ jobs:
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
run: |
gem push omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
- name: Configure RubyGems Credentials
uses: rubygems/configure-rubygems-credentials@main
- name: Publish to RubyGems
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
run: |
gem push omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem
42 changes: 13 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,26 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: "3.3"
omniauth: "~> 2.1"
- ruby: "3.2"
omniauth: "~> 2.1"
- ruby: "3.1"
omniauth: "~> 2.1"
- ruby: "3.0"
omniauth: "~> 2.1"
omniauth: "~> 2.1.2"
- ruby: "2.7"
omniauth: "~> 2.0.4"
- ruby: "2.6"
omniauth: "~> 1.4"
- ruby: "2.5"
omniauth: "~> 1.4"
- ruby: "2.4"
omniauth: "~> 1.4"
- ruby: "2.3"
omniauth: "~> 1.4"
container:
image: ruby:${{ matrix.ruby }}
env:
CI: true
OMNIAUTH_VERSION: "${{ matrix.omniauth }}"
omniauth: "~> 1.9.2"
env:
CI: true
OMNIAUTH_VERSION: "${{ matrix.omniauth }}"
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
restore-keys: |
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
bundle-${{ matrix.ruby }}-
- name: Upgrade Bundler to 2.0 (for older Rubies)
run: gem install bundler -v '~> 2.0'
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install
bundle update
- name: Run Rubocop
run: bundle exec rubocop
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run RSpec
run: bundle exec rspec

0 comments on commit 1dcad66

Please sign in to comment.