-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.3 KB
/
account_microservice.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Workflow to test the connection to mongoDB on pushes to any branch
name: Account Microservice
# Runs on push to any branch
on:
push:
# ** means all branches and tags
branches: ["**"]
# Workflow can be triggered manually from the Actions tab
workflow_dispatch:
jobs:
# Run tests
mongodb_connect:
runs-on: ubuntu-latest
services:
mongo:
image: mongo
env:
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
MONGO_INITDB_DATABASE: ${{ secrets.MONGO_INITDB_DATABASE }}
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Test mongoDB connection
run: |
echo "Make account microservice unit test"
env:
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
MONGO_INITDB_DATABASE: ${{ secrets.MONGO_INITDB_DATABASE }}
timeout-minutes: 1