Skip to content

Commit c35cfd3

Browse files
authored
Merge pull request #27 from nour-karoui/feat/add-ci-cd-pipeline
add a ci/cd pipeline to run tests
2 parents 16090dc + 9dc5037 commit c35cfd3

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/test-plugin.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI - Test Mongoose Plugin
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
mongo:
15+
image: mongo:7
16+
ports:
17+
- 27017:27017
18+
options: >-
19+
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
20+
--health-interval 10s
21+
--health-timeout 5s
22+
--health-retries 5
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run tests
37+
env:
38+
MONGO_URL: mongodb://localhost:27017/test
39+
run: npm test

0 commit comments

Comments
 (0)