Update Dockerfile added comment url to find json-path-api plugin #12
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: Test Docker Compose Setup | |
on: | |
push: | |
branches: [ dev ] | |
pull_request: | |
branches: [ dev ] | |
schedule: | |
- cron: '0 0 * * 0' # Run weekly on Sundays at midnight UTC | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build and start Docker Compose services | |
working-directory: ./setup | |
run: | | |
docker-compose build --progress=plain --no-cache | |
docker-compose up -d | |
- name: Display Docker build logs | |
if: failure() | |
working-directory: ./setup | |
run: | | |
docker-compose logs --no-color | tee build_logs.txt | |
echo "BUILD LOGS:" | |
cat build_logs.txt | |
- name: Upload build logs | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: build-logs | |
path: setup/build_logs.txt | |
- name: Wait for services to be ready | |
run: sleep 30 | |
- name: Check if services are running | |
working-directory: ./setup | |
run: | | |
if docker-compose ps | grep -q "Up"; then | |
echo "Services are up and running." | |
else | |
echo "Error: Services failed to start properly." | |
exit 1 | |
fi | |
- name: Test Jenkins service | |
run: | | |
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 | grep -q "403"; then | |
echo "Jenkins service is responding (403 is expected without authentication)." | |
else | |
echo "Error: Jenkins service is not responding as expected." | |
exit 1 | |
fi | |
- name: Test Docker service | |
working-directory: ./setup | |
run: | | |
if docker-compose exec -T docker docker info > /dev/null 2>&1; then | |
echo "Docker service is functioning properly." | |
else | |
echo "Error: Docker service is not functioning as expected." | |
exit 1 | |
fi | |
- name: Clean up | |
if: always() | |
working-directory: ./setup | |
run: docker-compose down -v |