-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.25 KB
/
ci.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
44
45
name: CI workflow
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
unit_testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10.6"
- name: Install docker
run: |
sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo docker --version
sudo apt install docker-ce
- name: Pull image from DockerHub
run: |
sudo docker pull huyuet/mongo:5.0
sudo docker pull huyuet/backend-image
- name: Run container
run: |
sudo docker network create mongodb_network
sudo docker run -d --name mongodb-server --network mongodb_network huyuet/mongo:5.0
sudo docker run -d --name backend --network mongodb_network huyuet/backend-image
- name: Run unittest
run: python API/unit_test/test_api.py