Skip to content

Commit 5ff52ff

Browse files
committed
CI: Lint code on GH actions
Linting runs parallel to testing and circle ci is slow and our free plan has limited resources. Also GH actions are better integrated and has better dev feedback.
1 parent 85a0a25 commit 5ff52ff

File tree

2 files changed

+62
-22
lines changed

2 files changed

+62
-22
lines changed

.circleci/config.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -232,27 +232,6 @@ commands:
232232
bundle exec rake -rrails -rspree/testing_support/extension_rake -e'Rake::Task["extension:test_app"].invoke'
233233
234234
jobs:
235-
lint_code:
236-
docker:
237-
- image: cimg/ruby:3.2-node
238-
environment:
239-
BUNDLE_ONLY: "lint"
240-
ESLINT_USE_FLAT_CONFIG: false
241-
steps:
242-
- checkout
243-
- run: "bundle install"
244-
- run:
245-
name: Check Ruby
246-
command: "bin/rake lint:rb"
247-
- run:
248-
name: Check ERB
249-
command: "bin/rake lint:erb"
250-
- run:
251-
name: Check JavaScript
252-
command: "bin/rake lint:js"
253-
- store_test_results:
254-
path: test-results
255-
256235
solidus_installer:
257236
executor:
258237
name: sqlite
@@ -362,7 +341,6 @@ jobs:
362341
workflows:
363342
build:
364343
jobs:
365-
- lint_code
366344
- solidus_installer
367345
- test_solidus_with_coverage # Only test with coverage support with the default versions
368346

.github/workflows/lint.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
env:
13+
BUNDLE_ONLY: "lint"
14+
15+
jobs:
16+
ruby:
17+
name: Check Ruby
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
- name: Install Ruby and gems
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: "3.2"
26+
bundler-cache: true
27+
- name: Lint Ruby files
28+
run: bin/rake lint:rb
29+
- name: Store test results
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: rubocop-results
33+
path: test-results
34+
35+
erb:
36+
name: Check ERB
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v3
41+
- name: Install Ruby and gems
42+
uses: ruby/setup-ruby@v1
43+
with:
44+
ruby-version: "3.2"
45+
bundler-cache: true
46+
- name: Lint ERB files
47+
run: bin/rake lint:erb
48+
49+
javascript:
50+
name: Check JavaScript
51+
runs-on: ubuntu-22.04
52+
env:
53+
ESLINT_USE_FLAT_CONFIG: false
54+
steps:
55+
- uses: actions/checkout@v3
56+
- name: Install Ruby and gems
57+
uses: ruby/setup-ruby@v1
58+
with:
59+
ruby-version: "3.2"
60+
bundler-cache: true
61+
- name: Lint JS files
62+
run: bin/rake lint:js

0 commit comments

Comments
 (0)