expressCart/.github/workflows/tests.yaml

45 lines
1.1 KiB
YAML
Raw Normal View History

2020-03-22 19:24:55 +10:00
name: expressCart tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
2020-03-22 19:37:33 +10:00
jobs:
2020-03-22 19:50:29 +10:00
container-job:
runs-on: ubuntu-latest
container:
image: node:10.16-jessie
services:
mongodb:
image: mongo
ports:
2020-03-22 19:37:54 +10:00
- 27017:27017
2020-03-22 19:50:29 +10:00
steps:
- uses: actions/checkout@v1
- run: npm ci
working-directory: ./mongodb
- run: node client.js
working-directory: ./mongodb
env:
# use mongodb for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
MONGODB_HOST: mongodb
MONGODB_PORT: ${{ job.services.mongodb.ports[27017] }}
2020-03-22 19:24:55 +10:00
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm i
- name: npm test
run: npm run test
env:
2020-03-22 19:50:29 +10:00
databaseConnectionString: mongodb://mongodb:27017/expresscart