-
Notifications
You must be signed in to change notification settings - Fork 26
43 lines (34 loc) · 1.18 KB
/
test-on-pr.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
name: Run Tests On Pull Request
on:
pull_request:
branches: [dev, main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js v20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Dependencies
run: |
npx corepack enable
pnpm install --frozen-lockfile
- name: setup environment variables (with opensearch)
run: |
echo "JWT_SECRET=${{ vars.TEST_JWT_SECRET }}" >> ./apps/api/.env.test
echo "OPENSEARCH_USE=true" >> ./apps/api/.env.test
echo "OPENSEARCH_NODE=http://localhost:9200" >> ./apps/api/.env.test
echo "OPENSEARCH_USERNAME=''" >> ./apps/api/.env.test
echo "OPENSEARCH_PASSWORD=''" >> ./apps/api/.env.test
- name: Run Tests
run: pnpm test
- name: setup environment variables (without opensearch)
run: |
rm ./apps/api/.env.test
echo "JWT_SECRET=${{ vars.TEST_JWT_SECRET }}" >> ./apps/api/.env.test
echo "OPENSEARCH_USE=false" >> ./apps/api/.env.test
- name: Run Tests
run: pnpm test