-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (41 loc) · 1.18 KB
/
dev_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: Run Tests and Create .env.development
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
MONGO_INITDB_ROOT_ROLE: dbOwner
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Create .env file
env:
PORT: $${{secrets.PORT}}
CONNECTION_STRING: "mongodb://test:test@localhost:27017"
JWT_SECRET: $${{secrets.JWT_SECRET}}
NODE_ENV: development
TEST_CONNECTION_STRING: ${{ secrets.TEST_CONNECTION_STRING }}
ORIGIN: "*"
run: |
echo "PORT=${PORT}" >> .env
echo "CONNECTION_STRING=${CONNECTION_STRING}" >> .env
echo "JWT_SECRET=${JWT_SECRET}" >> .env
echo "NODE_ENV=${NODE_ENV}" >> .env
echo "TEST_CONNECTION_STRING=${TEST_CONNECTION_STRING}" >> .env
- name: Run Jest tests
run: npm test