This commit is contained in:
@@ -14,38 +14,15 @@ jobs:
|
||||
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: Get meta.
|
||||
# id: meta
|
||||
# run: |
|
||||
# echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
#
|
||||
# - name: Check meta.
|
||||
# run: echo ${{ steps.meta.outputs.REPO_NAME }}
|
||||
|
||||
# - name: Build test image.
|
||||
# run: |
|
||||
# docker build \
|
||||
# --file Dockerfile.test \
|
||||
# --tag ${{ steps.meta.outputs.REPO_NAME }}:test \
|
||||
# ${{ gitea.workspace }}
|
||||
|
||||
- name: Build test image.
|
||||
run: |
|
||||
docker compose build test
|
||||
|
||||
- name: Run Test
|
||||
run: touch .env && docker compose run --rm test
|
||||
# run: >
|
||||
# docker run --rm \
|
||||
# -e MOSQUITTO_SERVER=mosquitto \
|
||||
# ${{ steps.meta.outputs.REPO_NAME }}:test swift test
|
||||
run: \
|
||||
touch .env \
|
||||
&& docker compose run --rm test
|
||||
|
||||
- name: Cleanup.
|
||||
if: always()
|
||||
run: docker stop mosquitto && docker rm -f mosquitto
|
||||
run: docker compose down
|
||||
|
||||
@@ -20,29 +20,16 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile.test
|
||||
working_dir: /app
|
||||
networks:
|
||||
- test
|
||||
depends_on:
|
||||
- mosquitto-test
|
||||
- mosquitto
|
||||
environment:
|
||||
- MOSQUITTO_SERVER=mosquitto-test
|
||||
command: /bin/bash -xc "swift package clean && swift test"
|
||||
|
||||
mosquitto-test:
|
||||
image: eclipse-mosquitto
|
||||
networks:
|
||||
- test
|
||||
- MOSQUITTO_SERVER=mosquitto
|
||||
command: /bin/bash -xc "swift test"
|
||||
|
||||
mosquitto:
|
||||
image: eclipse-mosquitto
|
||||
volumes:
|
||||
- ./mosquitto/config:/mosquitto/config
|
||||
- ./mosquitto/certs:/mosquitto/certs
|
||||
ports:
|
||||
- "1883:1883"
|
||||
- "8883:8883"
|
||||
- "8080:8080"
|
||||
- "8081:8081"
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.mosquitto
|
||||
|
||||
networks:
|
||||
test:
|
||||
|
||||
Reference in New Issue
Block a user