lab1: add CI/CD testing
This commit is contained in:
26
.gitea/workflows/testing.yaml
Normal file
26
.gitea/workflows/testing.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Test Agent
|
||||
on: [push]
|
||||
jobs:
|
||||
test-agent-run:
|
||||
runs-on: debian-x86_64
|
||||
steps:
|
||||
- name: Fetch the repository
|
||||
run: git clone --branch ${{ gitea.ref }} --depth 1 http://10.1.1.1:3000/${{ gitea.repository }}
|
||||
|
||||
- run: cd sem8-iot-test/agent/docker
|
||||
|
||||
- name: Build containers
|
||||
run: docker-compose -f docker-compose-test.yaml build
|
||||
|
||||
- name: Start MQTT broker
|
||||
run: docker-compose -f docker-compose-test.yaml up -d mqtt
|
||||
|
||||
- name: Start agent
|
||||
run: docker-compose -f docker-compose-test.yaml run fake_agent
|
||||
|
||||
job-cleanup:
|
||||
if: always()
|
||||
needs: test-agent-run
|
||||
steps:
|
||||
- name: Clean containers
|
||||
run: docker-compose -f docker-compose-test.yaml down
|
||||
Reference in New Issue
Block a user