-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (41 loc) · 1.3 KB
/
test.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
name: Lint & Test Workflow
on:
pull_request:
branches: [main, dev]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }}
MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }}
DATABASE_URL: ${{ secrets.DATABASE_URL_TEST }}
JWT_SECRET: jwtsecret
AT_SECRET: atsecret
RT_SECRET: rtsecret
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
DISCORD_CLIENT_SECRET: ${{ secrets.DISCORD_CLIENT_SECRET }}
DISCORD_CALLBACK_URL: /api/v1/auth/discord/redirect
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: yarn install
- name: Run Eslint
run: yarn lint
- name: Run unit tests
run: |
if [ ${{ github.event.pull_request.base.ref }} == "main" ]; then
yarn test:unit
fi
- name: Push latest schema to the test database
run: npx prisma db push --accept-data-loss
- name: Run e2e tests
run: |
if [ ${{ github.event.pull_request.base.ref }} == "main" ]; then
yarn test:e2e --testTimeout=300000
fi