Migrate to docker compose #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |