Files
swift-mqtt-dewpoint/.gitea/workflows/ci.yaml
Michael Housh 853a157ae7
Some checks failed
CI / Run Tests (push) Failing after 11s
feat: Run CI
2024-11-14 19:35:26 -05:00

51 lines
1.3 KiB
YAML

---
name: CI
on:
push:
pull_request:
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Start MQTT.
run: >
docker run -d --name mosquitto \
-p "1883:1883" \
-p "8883:8883" \
-p "8080:8080" \
-p "8081:8081" \
eclipse-mosquitto:latest
# - name: Build the test image.
# uses: docker/build-push-action@v5
# with:
# context: .
# file: Dockerfile.test
# platforms: |
# linux/arm64
# linux/amd64
# push: true
# tags: |
# git.housh.dev/michael/${{ gitea.repository }}:${{ gitea.sha }}
- name: Build test image.
run: >
docker buildx build \
-file Dockerfile.test \
--tag ${{ gitea.repositry }}:test \
--load
./
- name: Run Test
run: >
docker run --rm \
-e MOSQUITTO_SERVER=127.0.0.1 \
${{ gitea.repository }}:${{ gitea.sha }} swift test
- name: Cleanup.
if: always()
run: docker stop mosquitto && docker rm -f mosquitto