Main Workflow #544
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: Main Workflow | |
on: | |
push: | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
name: Build | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
node-version: [14, 16, 17, 18, 19, 20] | |
runs-on: ubuntu-latest | |
container: node:${{ matrix.node-version }}-buster | |
steps: | |
- name: Checkout code from repository | |
uses: actions/checkout@v3 | |
- name: Instal MongoDB | |
run: | | |
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - | |
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list | |
apt-get update && apt-get update && apt-get install -y mongodb-org mongodb-org-server mongodb-org-database\ | |
mongodb-org-mongos mongodb-org-shell mongodb-org-tools && mkdir -p /data/db | |
- name: Start MongoDB instance | |
run: mongod & | |
- name: Print Node.js information | |
run: node --version | |
- name: Install package | |
run: npm install | |
- name: Install package (development) | |
run: npm install --only=dev | |
- name: Build package | |
run: npm run build | |
- name: Verify Javascript code linting | |
run: npm run lint | |
- name: Run unit tests | |
run: MONGO_URL=mongodb://localhost/test npm test |