2023-05-29 23:42:24 +03:00
|
|
|
name: CI Server
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-27 18:55:07 +03:00
|
|
|
branches:
|
|
|
|
- main
|
2023-09-17 02:33:23 +03:00
|
|
|
pull_request:
|
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:
|
2023-12-15 17:40:04 +03:00
|
|
|
image: twentycrm/twenty-postgres
|
2023-07-27 19:48:40 +03:00
|
|
|
env:
|
2023-12-15 17:40:04 +03:00
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_USER: postgres
|
2023-07-28 01:14:33 +03:00
|
|
|
ports:
|
|
|
|
- 5432:5432
|
2023-05-29 23:42:24 +03:00
|
|
|
steps:
|
2023-11-07 01:31:26 +03:00
|
|
|
- name: Cancel Previous Runs
|
|
|
|
uses: styfle/cancel-workflow-action@0.11.0
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
2023-09-17 02:33:23 +03:00
|
|
|
- uses: actions/checkout@v4
|
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-12-15 17:40:04 +03:00
|
|
|
run: yarn
|
2023-05-29 23:42:24 +03:00
|
|
|
- name: Server / Run linter
|
2023-12-15 17:40:04 +03:00
|
|
|
run: yarn nx lint twenty-server
|
2023-05-29 23:42:24 +03:00
|
|
|
- name: Server / Run jest tests
|
2023-12-15 17:40:04 +03:00
|
|
|
run: yarn nx test twenty-server
|
2024-03-25 13:00:11 +03:00
|
|
|
- name: Server / Build
|
|
|
|
run: yarn nx build twenty-server
|
|
|
|
- name: Server / Write .env
|
|
|
|
run: |
|
|
|
|
cd packages/twenty-server
|
|
|
|
cp .env.example .env
|
|
|
|
- name: Worker / Run
|
|
|
|
run: MESSAGE_QUEUE_TYPE=sync yarn nx queue:work twenty-server
|