-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (82 loc) · 2.64 KB
/
ci-frourio.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
name: Test
on: push
jobs:
monorepo:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
env:
API_SERVER_PORT: 8080
API_ORIGIN: http://localhost:8080
API_BASE_PATH: /api
DATABASE_URL: postgresql://root:test@localhost:5432/test
TEST_DATABASE_URL: postgresql://root:test@localhost:5432/test
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: test
POSTGRES_USER: root
POSTGRES_DB: test
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 18
# - name: Setup testing environment
# run: |
# docker-compose up -d
- uses: actions/cache@v2
id: root-npm-cache
with:
path: "node_modules"
key: client-npm-${{ hashFiles('package-lock.json') }}
- uses: actions/cache@v2
id: client-npm-cache
with:
path: "nftfun-monorepo-frontend/node_modules"
key: client-npm-${{ hashFiles('nftfun-monorepo-frontend/package-lock.json') }}
- uses: actions/cache@v2
id: server-npm-cache
with:
path: "nftfun-monorepo-backend/node_modules"
key: client-npm-${{ hashFiles('nftfun-monorepo-backend/package-lock.json') }}
- run: npm install
if: steps.root-npm-cache.outputs.cache-hit != 'true'
- run: npm install --prefix nftfun-monorepo-frontend
if: steps.client-npm-cache.outputs.cache-hit != 'true'
- run: npm install --prefix nftfun-monorepo-backend
if: steps.server-npm-cache.outputs.cache-hit != 'true'
- name: Execute frontend lint
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review # Change reporter.
workdir: .
eslint_flags: "nftfun-monorepo-frontend/"
- name: Execute backend lint
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review # Change reporter.
workdir: .
eslint_flags: "nftfun-monorepo-backend/"
- name: Setup DB
run: |
sudo systemctl start postgresql.service
- run: npm run generate
- run: npm run typecheck
- name: Test
run: |
export NODE_OPTIONS="--max_old_space_size=4000"
cd nftfun-monorepo-backend
npm run migrate:dev
npm run test
env:
API_JWT_SECRET: test_secret