Skip to content

Commit

Permalink
Start MongoDB as a service in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiSG committed Aug 23, 2022
1 parent 53934fe commit 50d8a24
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ jobs:

runs-on: ${{ matrix.operating_system }}

services:
mongo:
image: mongo
ports:
- 27017:27017

steps:
- run: |
git config --global user.name 'Open Terms Archive Bot'
Expand All @@ -26,18 +32,9 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Start MongoDB
run: |
mkdir /tmp/test-database
mongod --dbpath /tmp/test-database --fork --logpath /tmp/mongodb-log
- run: npm ci
- run: npm test
- name: Archive database logs
uses: actions/upload-artifact@v3
with:
name: mongodb-log
path: /tmp/mongodb-log


validate_declarations:
strategy:
matrix:
Expand Down

0 comments on commit 50d8a24

Please # to comment.