Merge pull request #34 from kiwijos/error-handling #31
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 installation of node dependencies | |
# build the source code and run tests across different versions of node and MongoDB | |
name: Node.js CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x, 20.x] | |
mongodb-version: ["4.2", "4.4", "5.0", "6.0"] | |
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 }} | |
cache: npm | |
- name: Start MongoDB | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
mongodb-port: 27017 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
env: | |
TRAFIKVERKET_API_KEY: ${{ secrets.TRAFIKVERKET_API_KEY }} | |
MONGO_URI_TEST: mongodb://localhost:27017 |