Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrowi committed Sep 27, 2023
1 parent 53c4e5b commit 06b0f2e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 87 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/github-actions-ci-brakeman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ on:

jobs:
brakeman:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
ruby: ['3.2.2']
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Security audit application code
run: bundle exec brakeman -q -w2
27 changes: 8 additions & 19 deletions .github/workflows/github-actions-ci-jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,20 @@ on: pull_request

jobs:
jest-test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

os: [ubuntu-latest]
node: [14.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v3

- name: Cache Node.js modules
uses: actions/cache@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --pure-lockfile
Expand Down
58 changes: 19 additions & 39 deletions .github/workflows/github-actions-ci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,38 @@
name: Pronto

on: [pull_request]

name: Pronto
permissions:
contents: read
pull-requests: write
statuses: write

jobs:
linters:
name: Linters
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [2.7]
os: [ubuntu-latest]
ruby: ['3.2.2']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- run: |
git fetch --no-tags --prune --depth=10 origin +refs/heads/*:refs/remotes/origin/*
git fetch --no-tags --prune --depth=60 origin +refs/heads/*:refs/remotes/origin/*
- name: Setup Ruby
uses: ruby/setup-ruby@v1

- name: Ruby gem cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: JS package cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: |
yarn install --pure-lockfile
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Setup pronto
run: gem install pronto pronto-rubocop

- name: Run Pronto
run: |
PRONTO_PULL_REQUEST_ID="${{ github.event.pull_request.number }}" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
run: bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
env:
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}"
36 changes: 8 additions & 28 deletions .github/workflows/github-actions-ci-rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ on: pull_request

jobs:
rspec-test:

runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: [2.7]
os: [ubuntu-latest]
ruby: ["3.2.2"]
runs-on: ${{ matrix.os }}

# Service containers to run with `container-job`
services:
Expand All @@ -34,40 +33,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby ${{ matrix.ruby-version }}
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Install dependencies
env:
RAILS_ENV: test
RAILS_GROUPS: development
run: |
bundle install
BUNDLE_WITH: development

- name: Copy database config yml
run: cp test/dummy/config/ci.database.yml test/dummy/config/database.yml

- name: Create db
env:
RAILS_ENV: test
run: bin/rails db:create

- name: Run migrations
env:
RAILS_ENV: test
run: bin/rails db:migrate

- name: Prepare assets
env:
RAILS_ENV: test
run: bundle exec rake db:test:prepare

- name: Run tests
env:
RAILS_ENV: test
run: bundle exec rspec


- name: Preparing assets and running tests
run: bundle exec rake

0 comments on commit 06b0f2e

Please sign in to comment.