-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (30 loc) · 1 KB
/
docker-image.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
name: UniCorn-P4 build
on:
push:
branches: [ "main"]
pull_request:
branches: [ "main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: UniCorn-P4 CI
run: cd docker && docker-compose build
- name: Run Backend Container
run: docker-compose up -d backend
working-directory: docker
- name: Run Frontend Container
run: docker-compose up -d frontend
working-directory: docker
- name: Run Mininet Container
run: docker-compose up -d netsim
working-directory: docker
- name: Wait for Containers to Start
run: sleep 15
- name: Test Backend
run: curl --fail http://localhost:5000/switches/active || (echo "Backend test failed" && exit 1)
- name: Test Frontend
run: curl --fail http://localhost:3000 || (echo "Frontend test failed" && exit 1)
- name: Test Mininet
run: curl --fail http://localhost:5001/switches/online || (echo "Mininet test failed" && exit 1)