hashie/.github/workflows/main.yml

100 lines
2.2 KiB
YAML

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
danger:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- uses: MeilCli/danger-action@v5
with:
danger_file: Dangerfile
danger_id: danger-pr
install_path: vendor/bundle
plugins_file: Gemfile
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.github_token }}
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 2.7
- name: Run integration tests
run: |
for dir in spec/integration/*; do
echo "testing $dir integration"
BUNDLE_GEMFILE=$dir/Gemfile bundle install --jobs 4 --retry 3
BUNDLE_GEMFILE=$dir/Gemfile bundle exec rspec $dir
done
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '3.1'
- '3.0'
- '2.7'
- '2.6'
- '2.5'
- '2.4'
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run tests
env:
RUBYOPT: "--disable-error_highlight"
run: bundle exec rake
test-jruby:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- macos
- ubuntu
jruby:
- jruby
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.jruby }}
- name: Install dependencies
env:
JRUBY_OPTS: --debug
run: bundle install --jobs 4 --retry 3
- name: Run tests
env:
JRUBY_OPTS: --debug
run: bundle exec rake