-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (73 loc) · 1.97 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build
on:
workflow_dispatch:
push:
branches:
- dev
pull_request:
branches:
- "*"
paths-ignore:
- "**.md"
jobs:
Linting:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
- name: Run Install
run: |
sudo apt-get -yqq install libpq-dev
gem update --system --no-document
gem install rake
gem install bundler
bundle install
- name: Run Linter (rubocop)
run: |
bundle exec rubocop --parallel --fail-level warning --display-only-fail-level-offenses --format json -o report.json
Testing:
if: ${{ github.actor != 'dependabot[bot]' }}
name: ${{ matrix.ruby }}
runs-on: ubuntu-latest
env:
COVERAGE_RUBY_VERSION: 3.1
BUNDLE_PATH: vendor/bundle
strategy:
fail-fast: false
matrix:
ruby:
- 3.1
- 3.2
- 3.3
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Update rubygems
run: |
gem update --system --no-document
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ env.BUNDLE_PATH }}
key: ruby-${{ matrix.ruby }}-gems-${{ hashFiles('cnab240_bancoabc.gemspec') }}
restore-keys: |
ruby-${{ matrix.ruby }}-gems-
- name: Prepare environment
run: |
sudo apt-get -y install libsqlite3-dev libxslt1-dev
- name: Install dependencies
run: |
bundle check || bundle install --full-index --jobs 6 --retry 3
- name: Run RSpec
run: bundle exec rspec