name: expressCart tests on: push: branches: [ master ] pull_request: branches: [ master ] jobs: 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: 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: databaseConnectionString: mongodb://mongodb:27017/expresscart