Update image tag to v1.0.6 #24
This file contains hidden or 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
| # Test workflow - Runs automated tests on pull requests | |
| # This workflow ensures code quality by running tests before merging to main | |
| name: Test | |
| # Trigger: Run on pull requests targeting the main branch | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test-docker: | |
| env: | |
| # Cloudinary dummy variables for testing | |
| CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }} | |
| CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }} | |
| CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }} | |
| # Use the latest Ubuntu runner for consistent test environment | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Check out the repository code including PR changes | |
| - uses: actions/checkout@v4 | |
| # Step 2: Set up Docker Buildx for Docker operations | |
| # Required for building and running Docker containers | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # Step 3: Execute the test suite using docker-compose | |
| # Runs tests in isolated container environment matching production | |
| - name: Run tests with docker-compose | |
| run: docker compose -f docker-compose-test.yml up --quiet-pull --abort-on-container-exit --exit-code-from sleepUp-test | |
| # --quiet-pull: Reduce output noise during image pulls | |
| # --abort-on-container-exit: Stop all containers when any container exits | |
| # --exit-code-from: Use exit code from specified container (sleepUp-test) | |
| # Step 4: Clean up Docker resources | |
| # Always runs regardless of test results to prevent resource leaks | |
| - name: Clean up | |
| if: always() # Run even if previous steps fail | |
| run: docker compose -f docker-compose-test.yml down -v | |
| # down: Stop and remove containers | |
| # -v: Remove associated volumes |