-
-
Notifications
You must be signed in to change notification settings - Fork 124
88 lines (72 loc) · 2.05 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
name: CI
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
# Cancel old builds on new commit for same workflow + branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: |
npm clean-install
npm run check
npm run test
prettier-check:
name: Prettier check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# Installing all dependencies takes up to three minutes, hacking around to only installing prettier+deps
- name: Download dependencies
run: |
rm package.json
rm package-lock.json
npm i prettier@3 prettier-plugin-sql@0.17.0
- name: Run prettier
run: |-
npx prettier -c '{src,test}/**/*.ts'
docker:
name: Build with docker
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
name: Checkout Repo
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx
- uses: docker/build-push-action@v5
with:
push: false
tags: pg-meta:test
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Check Health status
run: |
docker run -d --name pg-meta-test pg-meta:test
state=$(docker inspect -f '{{ .State.Health.Status}}' pg-meta-test)
if [ $state != "starting" ]; then
exit 1
fi
sleep 10
state=$(docker inspect -f '{{ .State.Health.Status}}' pg-meta-test)
docker stop pg-meta-test
if [ $state == "healthy" ]; then
exit 0
else
exit 1
fi