-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (46 loc) · 1.34 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
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
env:
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
- name: Install Bundler
run: gem install bundler
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 16.19.0
- name: Setup the Rails application
env:
RAILS_ENV: test
run: |
sudo apt-get -yqq install libpq-dev build-essential
bundle install --no-deployment --jobs 4 --retry 3
cp config/database.github.yml config/database.yml
bundle exec rails db:create
bundle exec rails db:migrate
yarn --frozen-lockfile
- name: Run unit tests
run: bundle exec rails test
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
- name: Publish code coverage
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}