Setting up github actions
parent
47a1117041
commit
d4e0ae85c9
|
@ -6,11 +6,26 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
jobs:
|
jobs:
|
||||||
|
container-job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: node:10.16-jessie
|
||||||
services:
|
services:
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:3.4.23
|
image: mongo
|
||||||
ports:
|
ports:
|
||||||
- 27017:27017
|
- 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:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -27,4 +42,4 @@ jobs:
|
||||||
- name: npm test
|
- name: npm test
|
||||||
run: npm run test
|
run: npm run test
|
||||||
env:
|
env:
|
||||||
test: true
|
databaseConnectionString: mongodb://mongodb:27017/expresscart
|
Loading…
Reference in New Issue