-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathtreetracker-wallet-api-pull-request-ci.yml
More file actions
65 lines (56 loc) · 1.83 KB
/
treetracker-wallet-api-pull-request-ci.yml
File metadata and controls
65 lines (56 loc) · 1.83 KB
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Wallet API CI for New Pull Requests
on:
pull_request:
branches:
- master
- 'v1.10'
- keycloak
env:
project-directory: ./
jobs:
build:
name: Run all tests
runs-on: ubuntu-latest
container: node:20.16.0-alpine3.20
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install git
run: apk add --no-cache git
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: npm clean install
run: npm ci --ignore-scripts
working-directory: ${{ env.project-directory }}
- name: run ESLint
run: npm run lint
working-directory: ${{ env.project-directory }}
- name: run db-migrate
run: npm run db-migrate-ci
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
- name: run test
run: npm run test
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
CI: true