-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (47 loc) · 1.28 KB
/
core.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
name: Test core
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
container: node:18.16-bookworm
services:
postgres:
image: postgres:15.3-alpine
env:
POSTGRES_PASSWORD: foo
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare database
env:
PGPASSFILE: /tmp/pgpass
run: |
apt update && apt install -y postgresql
echo 'postgres:5432:*:postgres:foo' > $PGPASSFILE
chmod 600 $PGPASSFILE
psql -h postgres -U postgres -w -c 'create database id;'
psql -h postgres -U postgres -w id < ./schema.sql
- name: Cache dependencies
uses: actions/cache@v3
with:
path: .yarn/cache
key: ${{ runner.os }}-build.1-core-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build.1-core-
${{ runner.os }}-build.1-
${{ runner.os }}-
- name: Install dependencies
run: 'yarn install --immutable'
- name: Run tests
run: 'yarn test'