Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests on github actions #132

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .circleci/config.yml

This file was deleted.

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]

concurrency:
group: lint-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: read

jobs:
ruby:
name: Check Ruby
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Lint Ruby files
run: bundle exec rubocop -ESP
70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test

on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 4" # every Thursday

concurrency:
group: test-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: read

jobs:
rspec:
name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }}
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
rails-version:
- "7.0"
- "7.1"
- "7.2"
ruby-version:
- "3.1"
- "3.4"
solidus-branch:
- "v4.1"
- "v4.2"
- "v4.3"
- "v4.4"
database:
- "postgresql"
- "mysql"
- "sqlite"
exclude:
- rails-version: "7.2"
solidus-branch: "v4.3"
- rails-version: "7.2"
solidus-branch: "v4.2"
- rails-version: "7.2"
solidus-branch: "v4.1"
- rails-version: "7.1"
solidus-branch: "v4.2"
- rails-version: "7.1"
solidus-branch: "v4.1"
- ruby-version: "3.4"
rails-version: "7.0"
env:
TEST_RESULTS_PATH: coverage/coverage.xml
steps:
- uses: actions/checkout@v4
- name: Run extension tests
uses: solidusio/test-solidus-extension@main
with:
database: ${{ matrix.database }}
rails-version: ${{ matrix.rails-version }}
ruby-version: ${{ matrix.ruby-version }}
solidus-branch: ${{ matrix.solidus-branch }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.TEST_RESULTS_PATH }}
13 changes: 6 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -21,22 +21,18 @@ gem 'concurrent-ruby', '< 1.3.5'
# Needed to help Bundler figure out how to resolve dependencies,
# otherwise it takes forever to resolve them.
# See https://github.com/bundler/bundler/issues/6677
gem 'rails', '>0.a'
rails_version = ENV.fetch('RAILS_VERSION', '7.2')
gem 'rails', "~> #{rails_version}"

case ENV.fetch('DB', nil)
when 'mysql'
gem 'mysql2'
when 'postgresql'
gem 'pg'
else
gem 'sqlite3', '~> 1.4'
gem 'sqlite3', '~> 1.7'
end

# While we still support Ruby < 3 we need to workaround a limitation in
# the 'async' gem that relies on the latest ruby, since RubyGems doesn't
# resolve gems based on the required ruby version.
gem 'async', '< 3' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')

gemspec

# Use a local Gemfile to include development dependencies that might not be
@@ -45,3 +41,6 @@ gemspec
# We use `send` instead of calling `eval_gemfile` to work around an issue with
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'

# Necessary for Ruby 3.4 support
gem "csv", "~> 3.3"