Replace operating system
with environment
#159
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-mosquitto: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y docker-compose | |
- name: Start Mosquitto service using Docker Compose | |
run: docker-compose up -d mosquitto | |
- name: Wait for Mosquitto to be healthy | |
run: | | |
for i in {1..10}; do | |
if docker inspect --format='{{.State.Status}}' mosquitto | grep -q running; then | |
echo "Mosquitto is running" | |
exit 0 | |
else | |
echo "Waiting for Mosquitto to be healthy..." | |
sleep 10 | |
fi | |
done | |
echo "Mosquitto did not become healthy in time" | |
exit 1 | |
- name: Stop Mosquitto service using Docker Compose | |
run: docker-compose down |