Skip to content

Commit

Permalink
Setting up github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Moffat authored and Mark Moffat committed Mar 22, 2020
1 parent 47a1117 commit d4e0ae8
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,26 @@ on:
pull_request:
branches: [ master ]
jobs:
services:
mongodb:
image: mongo:3.4.23
ports:
container-job:
runs-on: ubuntu-latest
container:
image: node:10.16-jessie
services:
mongodb:
image: mongo
ports:
- 27017:27017
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] }}
build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -27,4 +42,4 @@ jobs:
- name: npm test
run: npm run test
env:
test: true
databaseConnectionString: mongodb://mongodb:27017/expresscart

0 comments on commit d4e0ae8

Please sign in to comment.