This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
Add CodeQL Analysis #263
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
on: [push, pull_request] | |
name: CI | |
jobs: | |
test_full: | |
name: Test (Linux) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [16.x, 18.x, 20.x] | |
mongodb-version: ['4.4', '5.0', 'latest'] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# Default Python (3.12) doesn't have support for distutils | |
# https://github.com/nodejs/node-gyp/issues/2869 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Start MongoDB ${{ matrix.mongodb-version }} | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
- name: Install Dependencies | |
run: npm install | |
- name: Test | |
run: npm test | |
env: | |
MONGODB_URI: mongodb://localhost/ | |
test: | |
name: Test (macOS, Windows) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, windows-latest] | |
node-version: [16.x, 18.x, 20.x] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# Default Python (3.12) doesn't have support for distutils | |
# https://github.com/nodejs/node-gyp/issues/2869 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Apply node-gyp workaround hack | |
if: ${{ matrix.os == 'windows-latest' }} | |
shell: bash | |
run: | | |
set -x | |
set -e | |
export NODE_JS_VERSION=$(node -p 'process.version.slice(1)') && | |
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh | |
bash node-gyp-bug-workaround.sh | |
- name: Install Dependencies | |
run: npm install | |
- name: Test | |
run: npm test |