-
-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (52 loc) · 1.32 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
name: Test
on:
push:
branches:
- test
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Fetch Project
uses: actions/checkout@v4
with:
submodules: true
token: ${{ github.token }}
- name: Set up Ruby and Bundle Install
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true
- name: Set up Nodejs
uses: actions/setup-node@v2
with:
node-version: 16.3
- name: Cache Node Modules
uses: actions/cache@v2
with:
path: test/dummy/node_modules
key: ${{ runner.OS }}-yarn-${{ hashFiles('test/dummy/yarn.lock') }}
- name: Install Javascript(Node.js) Dependencies
run: |
yarn install --cwd test/dummy --check-files
- name: Prepare DB
run: |
RAILS_ENV=test bin/rails app:db:prepare
RAILS_ENV=test bin/rails g rails_extend:migrations -f
RAILS_ENV=test bin/rails db:migrate
- name: Run Test
run: |
bin/rails test -v -b