forked from Shigawire/hipstermaps
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (74 loc) · 2.23 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Test
on: push
env:
PRECOMMIT: false
DISABLE_SPRING: true
CAPYBARA_BROWSER_ARGS: "--no-sandbox --disable-dev-shm-usage"
RAILS_ENV: test
RACK_ENV: test
NODE_VERSION: "12.19.0"
jobs:
rspec:
name: RSpec
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:11.8-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: railsprojecttemplate_test
POSTGRES_PASSWORD: password
ports:
# will assign a random free host port
- 5432:5432
chrome:
image: browserless/chrome
ports:
- 3000:3000
# Steps to run the build and test
# --------------------------------------
steps:
- name: checkout-repo
uses: actions/checkout@v2
# setup Ruby & bundle install with cache
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Automatically runs bundle install and caches the gems
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- uses: zweitag/github-actions/global-variables@master
with:
file: '.env.test'
# before_install
- run: gem install bundler --no-document
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
# install
# before_script
- name: Setup test database
run: bin/rails db:test:prepare
env:
DATABASE_URL_WITHOUT_DB_NAME: postgresql://postgres:password@localhost/railsprojecttemplate_test
- name: Rspec
run: bin/rspec test
env:
DATABASE_URL_WITHOUT_DB_NAME: postgresql://postgres:password@localhost/railsprojecttemplate_test
rufo:
name: Rufo
runs-on: ubuntu-18.04
steps:
- name: checkout-repo
uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
- run: gem install rufo
- run: rufo -c .