Skip to content

Commit 8b4ce8a

Browse files
committed
Use GH actions to run tests
We want to migrate away from circle ci
1 parent 5638b51 commit 8b4ce8a

4 files changed

Lines changed: 98 additions & 67 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on: [pull_request]
4+
5+
concurrency:
6+
group: lint-${{ github.ref_name }}
7+
cancel-in-progress: ${{ github.ref_name != 'main' }}
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
ruby:
14+
name: Check Ruby
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
- name: Install Ruby and gems
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: "3.2"
23+
bundler-cache: true
24+
- name: Lint Ruby files
25+
run: bundle exec rubocop -ESP

.github/workflows/test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: "0 0 * * 4" # every Thursday
10+
11+
concurrency:
12+
group: test-${{ github.ref_name }}
13+
cancel-in-progress: ${{ github.ref_name != 'main' }}
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
rspec:
20+
name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }}
21+
runs-on: ubuntu-24.04
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
rails-version:
26+
- "7.0"
27+
- "7.1"
28+
- "7.2"
29+
ruby-version:
30+
- "3.1"
31+
- "3.4"
32+
solidus-branch:
33+
- "v4.1"
34+
- "v4.2"
35+
- "v4.3"
36+
- "v4.4"
37+
- "v4.5"
38+
database:
39+
- "postgresql"
40+
- "mysql"
41+
- "sqlite"
42+
exclude:
43+
- rails-version: "7.2"
44+
solidus-branch: "v4.3"
45+
- rails-version: "7.2"
46+
solidus-branch: "v4.2"
47+
- rails-version: "7.2"
48+
solidus-branch: "v4.1"
49+
- rails-version: "7.1"
50+
solidus-branch: "v4.2"
51+
- rails-version: "7.1"
52+
solidus-branch: "v4.1"
53+
- ruby-version: "3.4"
54+
rails-version: "7.0"
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Run extension tests
58+
uses: solidusio/test-solidus-extension@main
59+
with:
60+
database: ${{ matrix.database }}
61+
rails-version: ${{ matrix.rails-version }}
62+
ruby-version: ${{ matrix.ruby-version }}
63+
solidus-branch: ${{ matrix.solidus-branch }}
64+
- name: Upload coverage reports to Codecov
65+
uses: codecov/codecov-action@v5
66+
continue-on-error: true
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
files: ./coverage/coverage.xml

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ gemspec
1010
branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
1111
gem 'solidus', github: 'solidusio/solidus', branch: branch
1212

13-
rails_version = ENV.fetch("RAILS_VERSION", "~> 7.0")
14-
gem 'rails', rails_version
13+
rails_version = ENV.fetch("RAILS_VERSION", "7.0")
14+
gem 'rails', "~> #{rails_version}"
1515

1616
gem 'bundler'
1717
gem 'rake'
@@ -21,13 +21,13 @@ group :test do
2121
gem 'mysql2'
2222
gem 'pg'
2323
gem 'solidus_auth_devise'
24-
gem 'sqlite3', rails_version < '~> 7.2' ? '~> 1.4' : '~> 2.0'
24+
gem 'sqlite3', rails_version < '7.2' ? '~> 1.4' : '~> 2.0'
2525
end
2626

2727
# Use a local Gemfile to include development dependencies that might not be
2828
# relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
2929
eval_gemfile 'Gemfile-local' if File.exist? 'Gemfile-local'
3030

31-
if rails_version == "~> 7.0"
31+
if rails_version == "7.0"
3232
gem 'concurrent-ruby', '< 1.3.5'
3333
end

0 commit comments

Comments
 (0)