fix: renamed workflow #4
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: Build | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- master | |
- develop | |
jobs: | |
test-installation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Create Docker services | |
run: | | |
docker compose up -d | |
# Wait for services to be healthy | |
sleep 30 | |
- name: Check Docker containers status | |
run: | | |
# Check if all containers are running | |
if [ "$(docker compose ps --status running | wc -l)" -lt 2 ]; then | |
echo "Not all containers are running. Current status:" | |
docker compose ps | |
docker compose logs | |
exit 1 | |
fi | |
- name: Test Grafana accessibility | |
run: | | |
# Wait for Grafana to be ready | |
timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "302" ]]; do sleep 5; done' || exit 1 | |
- name: Test MQTT broker | |
run: | | |
# Install mosquitto-clients for MQTT testing | |
sudo apt-get update && sudo apt-get install -y mosquitto-clients | |
# Test MQTT connection | |
mosquitto_sub -h localhost -p 1883 -t test_topic -C 1 & | |
mosquitto_pub -h localhost -p 1883 -t test_topic -m "test message" | |
- name: Cleanup | |
if: always() | |
run: docker compose down |