This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (90 loc) · 3.22 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
- prod
- dev
pull_request:
branches:
- master
- prod
env:
NODE_ENV: ci
DEBUG: "*,-express*,-babel*,-eslint*,-nodemon*,supertest,bat-ratios"
DEBUG_COLORS: 'true'
CURRENCY_OXR_API_ID: ${{ secrets.CURRENCY_OXR_API_ID }}
DATABASE_URL: postgres://ratios:password@localhost:5010/ratios
EARLIEST_BACKFILL: '2018-12-31'
LATEST_BACKFILL: '2019-01-04'
GRPC_ENABLED: '1'
TOKEN_LIST: e1d49630-234d-4e6c-950f-6ad773f03f86
REDIS_URL: redis://localhost:5011
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
ci:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Setup Node.js environment
uses: actions/setup-node@c6fd00ceb9747fb23ffdf72987450a2664414867
with:
# Set always-auth in npmrc
always-auth: true
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
node-version: >=14.17
# Set this option if you want the action to check for the latest available version that satisfies the version spec
check-latest: true
- run: yarn --version
- name: Docker Compose Install
uses: KengoTODA/actions-setup-docker-compose@92cbaf8ac8c113c35e1cedd1182f217043fbdd00
with:
version: '1.25.4'
- run: docker-compose pull
- name: Cache Docker Images
uses: satackey/action-docker-layer-caching@da67a6cd88114ce3e232893dc6d946efa225aefb
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
with:
key: docker-cache-{hash}
restore-keys: |
docker-cache-
- run: yarn
# Runs a single command using the runners shell
- name: Run security checks (audit + lint)
run: yarn run security
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ~/.yarn
key: v1-yarn-deps-${{ hashFiles('**/yarn.lock') }}
restore-keys: v1-yarn-deps-
# Runs a set of commands using the runners shell
- name: Stand up Postgres
run: |
yarn run docker-up-dbs
sleep 3
- name: Migrate DBs
run: yarn run docker-migrate-dbs
- name: Fill DBs
run: yarn run history
- name: Print Checks
run: |
sleep 5
docker ps
docker-compose logs
- name: Test
run: yarn run test
- name: Check Migrating Down
run: yarn run migrate-down
# - name: Coverage
# run: yarn run coverage
# - name: Submit Code Coverage
# run: npx codecov --file=./coverage/lcov.info