Skip to content

Commit

Permalink
Adding test to test.yml github action
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanjaw committed Oct 25, 2024
1 parent 62b8622 commit 51005e6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,31 @@ jobs:
docker logs cronned-rclone # Print logs for debugging
exit 1 # Fail the job
fi
- name: Test Ofelia (with labels)
run: |
# Run the container in detached mode
docker run --name cronned-rclone \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v ${PWD}/rclone/rclone.conf:/config/rclone/rclone.conf \
-v ${PWD}/rclone/logs:/logs \
-v ${PWD}/rclone/data:/data \
-v ${PWD}/test.txt:/tmp/test.txt \
--label ofelia.enabled=true \
--label ofelia.job-local.example.schedule="@every 2s" \
--label ofelia.job-local.example.command="/bin/echo 'Hello Ofelia'" \
-d ${{ env.DOCKER_IMAGE_TAG }} daemon --docker
# Wait for 3 seconds
sleep 10
# Check logs for "Hello Ofelia"
if docker logs cronned-rclone | grep -q "Hello Ofelia"; then
echo "Output found: Hello Ofelia"
else
echo "Expected output not found"
docker logs cronned-rclone # Print logs for debugging
exit 1 # Fail the job
fi

0 comments on commit 51005e6

Please sign in to comment.