forked from codex-team/notes.api
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.09 KB
/
run-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
47
48
49
50
51
52
53
54
55
name: Run tests
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
tests:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: codex
POSTGRES_DB: notes
POSTGRES_PASSWORD: postgres
ports:
- 127.0.0.1:5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
volumes:
- ./database:/var/lib/postgresql/data
steps:
- name: Wait for PostgreSQL
uses: jakejarvis/wait-action@master
with:
time: '20s'
- name: Set permissions for database directory
run: sudo chmod -R 777 database
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test