Skip to content

Commit

Permalink
chore: rework workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
dasheck0 committed Aug 27, 2024
1 parent 9e4f5a8 commit 44eb93f
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions .github/workflows/test_and_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,51 @@ on:
- '**'

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true

- name: Lint via rubocop
run:
bundle exec rake -- rubocop

test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
ruby-version: ["2.7", "3.0", "3.1", "3.2", "3.4"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Test
run: |
bundle exec rake -- test
sonar:
runs-on: ubuntu-20.04
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.0' # Specify the Ruby version you are using
bundler-cache: true # Caches 'bundle install' automatically

- name: Install dependencies
run: bundle install

- name: Run RuboCop
run: bundle exec rubocop

- name: Run tests
run: bundle exec rake test
ruby-version: "3.0"
bundler-cache: true

- name: Run SonarCloud Scan
env:
Expand Down

0 comments on commit 44eb93f

Please sign in to comment.