Skip to content

Commit

Permalink
CI: Lint code on GH actions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tvdeyen committed Jan 15, 2025
1 parent 332ed17 commit 7275966
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,27 +232,6 @@ commands:
bundle exec rake -rrails -rspree/testing_support/extension_rake -e'Rake::Task["extension:test_app"].invoke'
jobs:
lint_code:
docker:
- image: cimg/ruby:3.2-node
environment:
BUNDLE_ONLY: "lint"
ESLINT_USE_FLAT_CONFIG: false
steps:
- checkout
- run: "bundle install"
- run:
name: Check Ruby
command: "bin/rake lint:rb"
- run:
name: Check ERB
command: "bin/rake lint:erb"
- run:
name: Check JavaScript
command: "bin/rake lint:js"
- store_test_results:
path: test-results

solidus_installer:
executor:
name: sqlite
Expand Down Expand Up @@ -362,7 +341,6 @@ jobs:
workflows:
build:
jobs:
- lint_code
- solidus_installer
- test_solidus_with_coverage # Only test with coverage support with the default versions

Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Lint

on: [pull_request]

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

permissions:
contents: read

env:
BUNDLE_ONLY: "lint"

jobs:
ruby:
name: Check Ruby
runs-on: ubuntu-22.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: bin/rake lint:rb
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: rubocop-results
path: test-results

erb:
name: Check ERB
runs-on: ubuntu-22.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 ERB files
run: bin/rake lint:erb

javascript:
name: Check JavaScript
runs-on: ubuntu-22.04
env:
ESLINT_USE_FLAT_CONFIG: false
steps:
- uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Lint JS files
run: bin/rake lint:js

0 comments on commit 7275966

Please sign in to comment.