Upgrade vulnerable dependencies fixing npm audit reports (#145) #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, build the source code and run tests. | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build and lint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
checkout_and_test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
- node-version: 12.x | |
lint: true # Linter is run only once to shorten the total build time | |
- node-version: 14.x | |
- node-version: 16.x | |
steps: | |
- name: Checkout code from ${{ github.repository }} | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: MongoDB in GitHub Actions | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: 3.4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter | |
if: ${{ matrix.lint }} | |
run: make lint | |
- name: Create test config | |
run: cp config/test.sample.json config/test.json | |
- name: Start test app | |
run: NODE_ENV=test node index.js & | |
- run: sleep 10s | |
- name: Run tests | |
run: make test |