update run script #37
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: Node.js CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mongo: | |
image: mongo | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install Dependencies | |
run: npm install | |
- name: Install MongoDB | |
run: | | |
sudo apt update | |
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - | |
echo "deb http://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org | |
- name: Start MongoDB | |
run: sudo service mongod start | |
- name: Run Tests | |
run: npm test |