-
-
Notifications
You must be signed in to change notification settings - Fork 36
55 lines (42 loc) · 1.34 KB
/
nodejs.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
name: 'tests'
on:
push:
branches:
- develop
- test
pull_request:
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout Project'
uses: 'actions/checkout@v4'
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16.15'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Lint code
run: yarn lint
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 5
mongodb-replica-set: rs0
- name: Wait for the database to start
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- localhost:27017 -- echo "Database is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3
- name: Setup test user
run: |
source .env && \
docker exec mongodb mongosh admin --eval "db.createUser({user: '${MONGO_INITDB_ROOT_USERNAME}', pwd: '${MONGO_INITDB_ROOT_PASSWORD}', roles: ['readWrite']})"
- name: Restart mongo
run: |
docker container restart mongodb
- name: Run tests
run: yarn test:ci
- name: Build files
run: yarn build-release