forked from robotex82/markerb
-
-
Notifications
You must be signed in to change notification settings - Fork 65
59 lines (57 loc) · 1.53 KB
/
test.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
---
name: test
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package_manager:
- npm
- yarn
rails_version:
- "~> 7.0"
- "~> 6.1"
ruby_version:
- "3.2"
- "3.1"
- "3.0"
- "2.7"
name: ${{ matrix.package_manager }}, Rails ${{ matrix.rails_version }}, Ruby ${{ matrix.ruby_version }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Install Bundler 2.4 for Ruby 2.7
if: matrix.ruby_version == '2.7'
run: gem install bundler -v 2.4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install rails dependencies
env:
RAILS_VERSION: ${{ matrix.rails_version }}
run: |
if [ "${{ matrix.ruby_version }}" = "2.7" ]; then
bundle _2.4_ install --jobs 4 --retry 3
else
bundle install --jobs 4 --retry 3
fi
- name: Install mjml with npm
if: ${{ matrix.package_manager == 'npm' }}
run: npm add mjml
- name: Install mjml with yarn
if: ${{ matrix.package_manager == 'yarn' }}
run: yarn add mjml
- name: Run tests
env:
RAILS_VERSION: ${{ matrix.rails_version }}
run: rake
- name: Run RuboCop
run: bundle exec rubocop