Skip to content

RUBY-Restore-Pipeline #439

RUBY-Restore-Pipeline

RUBY-Restore-Pipeline #439

Workflow file for this run

name: Pipeline
on:
push:
branches:
- master
- develop
tags:
- '*/*.*.*'
pull_request:
branches:
- master
- develop
jobs:
linting:
name: "Running ${{ matrix.linter }}"
runs-on: ubuntu-latest
container: ruby:3.0
timeout-minutes: 10
strategy:
matrix:
linter: ['debride', 'fasterer', 'flay', 'rubocop']
steps:
- name: Setup Dependencies Cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: bundle-use-linter-${{ matrix.linter }}
restore-keys: |
bundle-use-linter-${{ matrix.linter }}
- name: Install Bundler
run: |
gem install bundler
- name: Copy Test Suite
uses: actions/checkout@v2
- name: Run the linter
run: |
cd ./.github/linters/
chmod +x ${{ matrix.linter }}.sh
./${{ matrix.linter }}.sh
- name: Upload results
if: failure()
uses: actions/upload-artifact@v2
with:
name: linter-artifacts-${{ matrix.linter }}
path: ./${{ matrix.linter }}_out.txt
rspec:
name: "Running rspec"
runs-on: macos-latest
needs: linting
timeout-minutes: 10
steps:
- name: Setup Dependencies Cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: bundle-use-ruby-rspec
restore-keys: |
bundle-use-ruby-rspec
- name: Copy Test Suite
uses: actions/checkout@v2
- name: Run the tests
run: |
gem install bundler
bundle config set path 'vendor/bundle'
bundle config set with 'puma_max'
HEADLESS=true bundle install
rm -f db/*.sqlite3
APP_LOG=STDOUT bundle exec rake db:setup RAILS_ENV=test
APP_LOG=STDOUT bundle exec rake db:migrate RAILS_ENV=test
APP_LOG=STDOUT RAILS_ENV=test bundle exec rspec --exclude-pattern spec/app/controllers/vulneruby_engine/static_controller_spec.rb
- name: Run headless test
run: |
bundle update
HEADLESS=true bundle exec rspec spec/app/controllers/vulneruby_engine/static_controller_spec.rb
- name: Move artifacts
if: ${{ always() }}
run: |
mv ./coverage ./upload/
mv ./test-results/results.xml ./upload/
- name: Upload results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: rspec-artifacts
path: ./upload/**