Skip to content

Commit

Permalink
Merge pull request #7 from mongoosejs/IslandRhythms/add-CI
Browse files Browse the repository at this point in the history
Create test.yml
  • Loading branch information
vkarpov15 authored Sep 14, 2023
2 parents 2876509 + 6dc4048 commit 8ab6b19
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test
on:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node: [14, 16, 18]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- run: npm install

- name: Setup
run: |
wget -q http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.8.tgz
tar xf mongodb-linux-x86_64-ubuntu2004-5.0.8.tgz
mkdir -p ./data/db/27017 ./data/db/27000
printf "\n--timeout 8000" >> ./test/mocha.opts
./mongodb-linux-x86_64-ubuntu2004-5.0.8/bin/mongod --fork --dbpath ./data/db/27017 --syslog --port 27017
sleep 2
mongod --version
echo `pwd`/mongodb-linux-x86_64-ubuntu2004-5.0.8/bin >> $GITHUB_PATH
- run: npm test

2 changes: 1 addition & 1 deletion test/examples.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Examples', function() {
};
}

yield mongoose.connect('mongodb://localhost:27017/updateversioning', connectOptions);
yield mongoose.connect('mongodb://127.0.0.1:27017/updateversioning', connectOptions);

yield mongoose.connection.dropDatabase();
});
Expand Down

0 comments on commit 8ab6b19

Please sign in to comment.