-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (74 loc) · 2.13 KB
/
tests.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
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
environment: test
services:
db:
image: postgres:11
env:
POSTGRES_USER: wrp
POSTGRES_PASSWORD: dev
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile
BUNDLE_BUILD__SASSC: "--disable-march-tune-native"
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Ruby & Bundle Install
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 10.13.0
- name: Configure Yarn Cache Location
id: cache-locations
run: |
echo "yarn_dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Check Yarn Cache
id: cache-yarn
uses: actions/cache@v3
with:
path: ${{ steps.cache-locations.outputs.yarn_dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install Javascript Packages
if: steps.cache-yarn.outputs.cache-hit != 'true'
run: |
yarn install --pure-lockfile
- name: Create Database
env:
POSTGRES_TEST_DB: wetrockpolice_test
POSTGRES_USER: wrp
POSTGRES_PASSWORD: dev
POSTGRES_HOST: localhost
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
bundle exec rake db:create
bundle exec rake db:migrate
- name: Run Tests
env:
POSTGRES_TEST_DB: wetrockpolice_test
POSTGRES_USER: wrp
POSTGRES_PASSWORD: dev
POSTGRES_HOST: localhost
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bundle exec rails test