Skip to content

Instantly share code, notes, and snippets.

@jrochkind
Created September 9, 2020 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrochkind/e2d1ff059470caadd5d5454382977b53 to your computer and use it in GitHub Desktop.
Save jrochkind/e2d1ff059470caadd5d5454382977b53 to your computer and use it in GitHub Desktop.
.github/workflows/main.yml
name: CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
# services:
# db:
# image: postgres:11
# ports: ['5432:5432']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1.45.0
with:
ruby-version: 2.7.1
- uses: Borales/actions-yarn@v2.3.0
with:
cmd: install
- name: Install Dependencies
run: |
# sudo apt install -yqq libpq-dev
gem install bundler
- name: Install Gems
run: |
bundle install
- name: Prepare Database
run: |
bundle exec rails db:prepare
- name: Run Tests
# env:
# DATABASE_URL: postgres://postgres:@localhost:5432/databasename
# RAILS_MASTER_KEY: ${{secrets.RAILS_MASTER_KEY}}
run: |
bundle exec rails test
- name: Create Coverage Artifact
uses: actions/upload-artifact@v2
with:
name: code-coverage
path: coverage/
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1.45.0
with:
ruby-version: 2.7.1
- name: Install Brakeman
run: |
gem install brakeman
- name: Run Brakeman
run: |
brakeman -f json > tmp/brakeman.json || exit 0
- name: Brakeman Report
uses: devmasx/brakeman-linter-action@v1.0.0
env:
REPORT_PATH: tmp/brakeman.json
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment