-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.4 KB
/
Copy pathruby.yml
File metadata and controls
50 lines (42 loc) · 1.4 KB
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
name: Ruby
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
ruby: [ '2.5', '2.6', '2.7' ]
name: Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v2
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Build
run: |
docker-compose -p djin_ruby_${{ matrix.ruby }} build --build-arg RUBY_VERSION=${{ matrix.ruby }} app
- name: Run tests
run: |
docker-compose -p djin_ruby_${{ matrix.ruby }} run --rm app rspec
env:
TMP_TEST_FILE_FOLDER: '/tmp'
- name: Publish code coverage
run: |
# TODO: Move to script
docker-compose -p djin_ruby_${{ matrix.ruby }} run --rm app 'export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" && ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}'
lint:
runs-on: ubuntu-18.04
name: Lint
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install Gems
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Rubocop
run: bundle exec rubocop