forked from smartchicago/kimball
-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (54 loc) · 1.73 KB
/
continuous-integration.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
name: continuous-integration
on: [push, pull_request]
jobs:
continuous-integration:
environment: test
env:
RAILS_ENV: test
DATABASE_URL: "mysql2://root:[email protected]:3306/test"
REDIS_URL: "redis://localhost:6379/0"
runs-on: Ubuntu-20.04
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# How to use Redis
redis:
image: redis:latest
ports:
- 6379:6379
steps:
- name: Install chromedriver
run: sudo apt-get install chromium-chromedriver chromium-browser libmysqlclient-dev
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-2-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-2-gems-
- name: Install gems
run: bundle config path vendor/bundle && bundle install -j 4
- name: setup databases
run: bundle exec rake db:create && bundle exec rake db:schema:load
env:
RAILS_MASTER_KEY: ${{ secrets.MASTER_KEY }}
- name: launch chrome
run: chromium --headless --disable-gpu --remote-debugging-port=9516 http://localhost &
- name: Run tests
env:
RAILS_MASTER_KEY: ${{ secrets.MASTER_KEY }}
run: bundle exec rake
- name: Code Climate Test Reporter
uses: aktions/codeclimate-test-reporter@v1
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: after-build