name: Run tests on: push: pull_request: jobs: test: strategy: matrix: node: [16.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} # Service containers to run with `container-job` services: # Label used to access the service container redis: # Docker Hub image image: redis # Set health checks to wait until redis has started options: >- --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 6379:6379 mongo: image: mongo env: MONGO_INITDB_ROOT_USERNAME: wildduck MONGO_INITDB_ROOT_PASSWORD: wildduck MONGO_INITDB_DATABASE: 'wildduck-test' options: >- --health-cmd mongo --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 27017:27017 steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - run: npm install - name: Run tests run: npm run runtest env: APPCONF_dbs_redis: redis://127.0.0.1:6379/1 APPCONF_dbs_mongodb: 'mongodb://wildduck:wildduck@127.0.0.1:27017/wildduck-test?authSource=admin'