-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.56 KB
/
on-pull-request-to-main.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
name: On pull request to main
on:
pull_request:
branches: [main]
env:
CI: true
AI_GIFTS_API_URL: http://localhost:3000
FREE_CURRENCY_API_KEY: ${{ secrets.FREE_CURRENCY_API_KEY }}
DATABASE_URL: postgres://postgres:password@localhost:5432/test
DATABASE_URL_UNPOOLED: postgres://postgres:password@localhost:5432/test
OPENAI_API_KEY: foo
OPENAI_ORG_ID: foo
PRINTIFY_API_TOKEN: ${{secrets.PRINTIFY_API_TOKEN}}
SHOP_ID: foo
STRIPE_SECRET_KEY: foo
REMOVE_BG_API_KEY: foo
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.11"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run lint check
run: npm run lint:check
- name: Run prettier check
run: npm run fmt:check
- name: npm build
run: npm run build
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.11"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:ci