-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (47 loc) · 1.38 KB
/
workflow.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
name: Run tests
on: [push]
jobs:
run-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.7-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: tell-us-who-you-employ
POSTGRES_PASSWORD: password
POSTGRES_DB: tell-us-who-you-employ_test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install required Node.js version
uses: actions/setup-node@v2
with:
node-version: 20.9.0
- name: Install dependent libraries
run: sudo apt-get install libpq-dev
- name: Yarn install
run: yarn --frozen-lockfile
- name: Setup database
env:
RAILS_ENV: test
run: |
bundle exec rails db:drop
bundle exec rails db:create
bundle exec rails db:migrate
- name: Compile assets
env:
RAILS_ENV: test
run: bundle exec rails assets:precompile
- name: Run tests
env:
RAILS_ENV: test
run: bundle exec rspec
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2