[Snyk] Security upgrade mongodb from 4.7.0 to 6.0.0 #142
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: Test | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/test.yml' | |
- 'package.json' | |
- 'index.js' | |
- 'lib/**' | |
- 'test/**.js' | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/test.yml' | |
- 'package.json' | |
- 'index.js' | |
- 'lib/**' | |
- 'test/**.js' | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: Lint JS-Files | |
steps: | |
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
- name: Setup node | |
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.1.1 | |
with: | |
node-version: 14 | |
- run: npm install | |
- name: Lint JS-Files | |
run: npm run lint-js | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [12, 14, 16, 18] | |
os: [ubuntu-18.04, ubuntu-20.04] | |
include: | |
- os: ubuntu-18.04 | |
mongo-os: ubuntu1804 | |
mongo: 4.0.2 | |
- os: ubuntu-20.04 | |
mongo-os: ubuntu2004 | |
mongo: 5.0.2 | |
exclude: | |
- os: ubuntu-18.04 | |
node: 18 | |
name: Node ${{ matrix.node }} MongoDB ${{ matrix.mongo }} | |
steps: | |
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
- name: Setup node | |
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.1.1 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm install | |
- name: Setup | |
run: | | |
wget -q https://downloads.mongodb.org/linux/mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}.tgz | |
tar xf mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}.tgz | |
mkdir -p ./data/db/27017 ./data/db/27000 | |
printf "\n--timeout 8000" >> ./test/mocha.opts | |
./mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}/bin/mongod --setParameter ttlMonitorSleepSecs=1 --fork --dbpath ./data/db/27017 --syslog --port 27017 | |
sleep 2 | |
mongod --version | |
echo `pwd`/mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}/bin >> $GITHUB_PATH | |
- run: npm test | |
test-replica-sets: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
name: Replica Set tests | |
steps: | |
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
- name: Setup node | |
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.1.1 | |
with: | |
node-version: 16 | |
- run: npm install | |
- name: Test | |
run: npm run test-rs | |
coverage: | |
needs: | |
- test-replica-sets | |
runs-on: ubuntu-20.04 | |
name: Coverage | |
steps: | |
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
- name: Setup node | |
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.1.1 | |
with: | |
node-version: 16 | |
- run: npm install | |
- name: Setup | |
run: | | |
wget -q https://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz | |
tar xf mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz | |
mkdir -p ./data/db/27017 ./data/db/27000 | |
printf "\n--timeout 8000" >> ./test/mocha.opts | |
./mongodb-linux-x86_64-ubuntu2004-5.0.2/bin/mongod --setParameter ttlMonitorSleepSecs=1 --fork --dbpath ./data/db/27017 --syslog --port 27017 | |
sleep 2 | |
mongod --version | |
echo `pwd`/mongodb-linux-x86_64-ubuntu2004-5.0.2/bin >> $GITHUB_PATH | |
- name: test with coverage | |
run: npm run test-coverage | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage | |
dependency-review: | |
name: Dependency Review | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Dependency review | |
uses: actions/dependency-review-action@v2 |