-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (53 loc) · 1.79 KB
/
ci-workflow.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
name: Continuous integration
on:
push:
paths:
- "**.js"
- "**.json"
- "**.yml"
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
app:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: ${{ vars.POSTGRES_USER_LOCAL }}
POSTGRES_PASSWORD: ${{ vars.POSTGRES_PASSWORD_LOCAL }}
POSTGRES_DB: ${{ vars.POSTGRES_DATABASE_LOCAL }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Database and Create Tables
run: PGPASSWORD=${{ vars.POSTGRES_PASSWORD_LOCAL }} psql -h ${{ vars.POSTGRES_HOST_LOCAL }} -U ${{ vars.POSTGRES_USER_LOCAL }} -d ${{ vars.POSTGRES_DATABASE_LOCAL }} -f ./src/database/docker-tables/tables.sql
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.15.0
- name: Install Dependencies
run: yarn install
- name: Run ESLint
run: yarn lint
- name: Run Tests
run: yarn test:github:actions
env:
POSTGRES_HOST_LOCAL: ${{ vars.POSTGRES_HOST_LOCAL }}
POSTGRES_PORT: 5432
POSTGRES_DATABASE_LOCAL: ${{ vars.POSTGRES_DATABASE_LOCAL }}
POSTGRES_USER_LOCAL: ${{ vars.POSTGRES_USER_LOCAL }}
POSTGRES_PASSWORD_LOCAL: ${{ vars.POSTGRES_PASSWORD_LOCAL }}
SERVER_HOST: ${{ vars.SERVER_HOST }}
SERVER_PORT: ${{ vars.SERVER_PORT }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
LOCALE: ${{ vars.LOCALE }}