-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.52 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
name: CI
on:
pull_request:
branches:
- dev
- prod
push:
branches:
- dev
jobs:
ci-build:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: install pnpm
run: npm i -g pnpm
- name: Caching dependencies
id: cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{runner.os}}-node-${{hashFiles('**/pnpm-lock.yml')}}
restore-keys: |
${{ runner.os }}-node-
- name: Install package
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm i --no-frozen-lockfile
- name: env set
working-directory: ./
run: |
touch .env
echo POSTGRESQL_DB=${{secrets.POSTGRESQL_DB}} >> .env
echo PORT=${{secrets.PORT}} >> .env
echo ORIGIN=${{secrets.ORIGIN}} >> .env
echo TESTING_TOKEN=${{secrets.TESTING_TOKEN}} >> .env
echo TESTING_PASSWORD=${{secrets.TESTING_PASSWORD}} >> .env
- name: prisma set
run: |
npx prisma generate --schema=src/prisma/schema.prisma
- name: Test unit
run: pnpm test:unit
# - name: Test E2E
# run: pnpm test:e2e
- name: test
run: |
timeout ${{vars.SLEEP}} nohup pnpm start > app.log || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
cat app.log