Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: build
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
.byebug_history
test/dummy/db/*
/node_modules/

*.gem
*.gem
Gemfile.lock
32 changes: 0 additions & 32 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,3 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Specify your gem"s dependencies in atomic_lti.gemspec.
gemspec

gem "composite_primary_keys"

group :development do
gem "sqlite3"
end

group :development, :test, :linter do
gem "byebug"
gem "factory_bot_rails"
gem "rubocop"
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "webmock"
end

group :test do
gem "launchy"
gem "rspec"
gem "rspec-rails"

gem "jwt", "~>2.7.0"
gem "json-jwt"
gem "httparty"
end

group :ci do
gem "brakeman"
gem "pronto"
gem "pronto-rubocop", require: false
end
Loading