Skip to content

Commit

Permalink
ci: add lint part to the ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Pastor committed Dec 4, 2023
1 parent ecb9b31 commit 55efae6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI

on:
push:
branches: [ master, community ]
pull_request:
branches: [ master, community ]
on: [push, pull_request]

jobs:
test:
Expand Down Expand Up @@ -39,3 +35,23 @@ jobs:
bundle install --jobs 4 --retry 3
bin/rails db:prepare
bin/rails test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.x
bundler-cache: true

- name: Security audit dependencies
run: bin/bundler-audit --update

- name: Security audit application code
run: bin/brakeman -q -w3

- name: Lint Ruby files
run: bundle exec rubocop --parallel
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,19 @@ gem 'pundit'
gem 'devise-i18n'
gem 'doorkeeper-i18n'
gem 'rails-i18n'
gem 'rubocop', require: false

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'brakeman'
gem 'bundler-audit'
gem 'byebug', platform: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'rubocop'
gem 'rubocop-rails', require: false
end

group :development do
# gem 'listen', '~> 3.2.1'
gem 'rubocop-rails', require: false
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ GEM
bcrypt (3.1.18)
bootsnap (1.13.0)
msgpack (~> 1.2)
brakeman (6.0.1)
builder (3.2.4)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
byebug (11.1.3)
carrierwave (2.1.1)
activemodel (>= 5.0.0)
Expand Down Expand Up @@ -256,6 +260,8 @@ PLATFORMS
DEPENDENCIES
bcrypt (~> 3.1.13)
bootsnap (>= 1.4.5)
brakeman
bundler-audit
byebug
carrierwave (~> 2.1.1)
carrierwave-base64 (~> 2.8.0)
Expand Down

0 comments on commit 55efae6

Please sign in to comment.