Ignore package-lock.json. #412
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bedrock Node.js CI | |
on: [push] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm install | |
- name: Run eslint | |
run: npm run lint | |
test-node: | |
needs: [lint] | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
services: | |
mongodb: | |
image: mongo:5 | |
ports: | |
- 27017:27017 | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: | | |
npm install | |
cd test | |
npm install | |
- name: Run test with Node.js ${{ matrix.node-version }} | |
run: | | |
cd test | |
npm test | |
test-node-with-auth: | |
needs: [test-node] | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
services: | |
mongodb: | |
image: mongo:5 | |
ports: | |
- 27017:27017 | |
env: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: example | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: | | |
npm install | |
cd test | |
npm install | |
- name: Run test with Node.js ${{ matrix.node-version }} | |
run: | | |
cd test | |
npm test | |
env: | |
MONGODB_USERNAME: root | |
MONGODB_PASSWORD: example | |
MONGODB_AUTHSOURCE: admin | |
coverage: | |
needs: [test-node] | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
services: | |
mongodb: | |
image: mongo:5 | |
ports: | |
- 27017:27017 | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: | | |
npm install | |
cd test | |
npm install | |
- name: Generate coverage report | |
run: | | |
cd test | |
npm run coverage-ci | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./test/coverage/lcov.info | |
fail_ci_if_error: true |