-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (53 loc) · 1.29 KB
/
ruby.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version:
- '2.5.1'
- '2.6.2'
- '2.7.1'
- '3.0.1'
- '3.1.2'
- '3.2.1'
env:
DB_DATABASE: workhorse
DB_USER: root
DB_PASSWORD: 'root'
DB_HOST: localhost
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Startup database
run: |
sudo /etc/init.d/mysql start
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE ${{ env.DB_DATABASE }};'
- name: Run rake tests
uses: nick-fields/retry@v2
with:
timeout_seconds: 120
retry_on: error
max_attempts: 3
command: bundle exec rake test TESTOPTS='--verbose'
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.1
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop