Skip to content

Update test.yml

Update test.yml #11

Workflow file for this run

name: Run tests
on:
push:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.17.0]
mongodb-version: [4.1.6]
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup node-gyp
run: yarn global add node-gyp@latest
- name: Install dependencies
run: yarn
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: rs
mongodb-port: 27017
- name: Restore MongoDB Test Data
run: mongorestore -d "mainstayX" ./dbTest
- name: Start App
run: |
JWT_SECRET="dhe?3wfje;wf1" \
DB_NAME="mainstayX" \
DB_PORT="27017" \
DB_HOST="127.0.0.1" \
LISTEN_API="4000" \
node ./src/app.js
- name: Run tests
run: yarn test