-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.48 KB
/
ci.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
name: CI
env:
# Required app environment variables
# https://github.com/TrailBuddies/api#environment-variables
DEV_API_DB_USER: test
DEV_API_DB_PASSWORD: test
EMAIL: [email protected]
PASSWORD: test1234
# CLOUDINARY_SECRET: ${{ secrets.CLOUDINARY_SECRET }}
# TOMTOM_API_KEY: ${{ secrets.TOMTOM_API_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
on:
workflow_dispatch:
push:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: ${{ env.DEV_API_DB_USER }}
POSTGRES_DB: ${{ env.DEV_API_DB_USER }}
POSTGRES_PASSWORD: ${{ env.DEV_API_DB_PASSWORD }}
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
PASSPHRASE: test-${{ matrix.os }}-${{ github.run_id }}
steps:
- uses: actions/checkout@master
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.1.2
env:
BUNDLE_DEPLOYMENT: "false"
- name: Setup Rails Database
run: RAILS_ENV='test' bin/keygen && bin/rails db:setup
- name: Test & publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bin/rails test
coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov
debug: true