2023-05-29 23:42:24 +03:00
|
|
|
name: CI Server
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-27 18:55:07 +03:00
|
|
|
branches:
|
|
|
|
- main
|
2023-06-26 20:21:51 +03:00
|
|
|
pull_request_target:
|
2023-05-29 23:42:24 +03:00
|
|
|
jobs:
|
2023-07-27 21:57:10 +03:00
|
|
|
server-test:
|
2023-07-27 19:48:40 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
env:
|
|
|
|
POSTGRES_HOST: postgres
|
2023-08-10 08:24:15 +03:00
|
|
|
POSTGRES_PASSWORD: twenty
|
|
|
|
POSTGRES_USER: twenty
|
2023-07-27 19:48:40 +03:00
|
|
|
POSTGRES_DB: test
|
|
|
|
POSTGRES_PORT: 5432
|
2023-07-28 01:14:33 +03:00
|
|
|
ports:
|
|
|
|
- 5432:5432
|
2023-07-27 19:48:40 +03:00
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
2023-05-29 23:42:24 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-07-05 10:16:45 +03:00
|
|
|
if: github.event_name == 'push'
|
2023-06-30 11:35:59 +03:00
|
|
|
with:
|
2023-07-05 01:04:05 +03:00
|
|
|
ref: ${{ github.head_ref || github.ref_name }}
|
2023-07-05 10:09:29 +03:00
|
|
|
- uses: actions/checkout@v3
|
2023-07-05 10:16:45 +03:00
|
|
|
if: github.event_name == 'pull_request_target'
|
2023-07-05 10:09:29 +03:00
|
|
|
with:
|
|
|
|
ref: "refs/pull/${{ github.event.number }}/merge"
|
2023-05-29 23:42:24 +03:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: "18"
|
|
|
|
- name: Server / Install Dependencies
|
2023-06-14 17:56:29 +03:00
|
|
|
run: cd server && yarn install
|
2023-05-29 23:42:24 +03:00
|
|
|
- name: Server / Run linter
|
2023-06-14 17:56:29 +03:00
|
|
|
run: cd server && yarn lint
|
2023-05-29 23:42:24 +03:00
|
|
|
- name: Server / Run jest tests
|
|
|
|
run: |
|
2023-06-14 17:56:29 +03:00
|
|
|
cd server && yarn test
|
2023-07-27 19:48:40 +03:00
|
|
|
- name: Server / Run e2e tests
|
|
|
|
run: |
|
2023-07-28 01:22:10 +03:00
|
|
|
cd server && yarn test:e2e
|