chore(deps): bump aiohttp from 3.12.15 to 3.13.3 #236
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
| name: Test Docker Image | |
| # TODO: set docker auth | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| push: | |
| tags: | |
| - "v*" | |
| pull_request: | |
| paths: | |
| - "Dockerfile" | |
| - "pyproject.toml" | |
| - "poetry.lock" | |
| - ".github/workflows/test-docker.yml" | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| env: | |
| IMAGE: nemoguardrails | |
| steps: | |
| # | |
| # Checkout the code | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Get runner architecture | |
| - name: Get runner architecture | |
| id: runner-arch | |
| run: echo "arch=$(uname -m)" >> $GITHUB_OUTPUT | |
| - name: Set Docker tags | |
| run: | | |
| ARCH=${{ steps.runner-arch.outputs.arch }} | |
| echo "TEST_TAG=${{ env.IMAGE }}:${{ github.sha }}-$ARCH" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| load: true | |
| tags: ${{ env.TEST_TAG }} | |
| # Start the container in detached mode | |
| - name: Start container | |
| run: docker run -d --name test_container -p 8000:8000 ${{ env.TEST_TAG }} | |
| # Wait for the container to be ready | |
| - name: Wait for container to be ready | |
| run: | | |
| echo "Waiting for container to be ready..." | |
| until curl --output /dev/null --silent --head --fail http://localhost:8000; do | |
| printf '.' | |
| sleep 1 | |
| done | |
| echo "Container is ready!" | |
| # Perform a health check on the server | |
| - name: Check server status | |
| run: | | |
| RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/v1/rails/configs) | |
| if [ "$RESPONSE_CODE" -ne 200 ]; then | |
| echo "Server responded with code $RESPONSE_CODE." | |
| exit 1 | |
| fi | |
| # Run additional tests on the running container | |
| - name: Run tests | |
| run: | | |
| # Example test command | |
| curl -f http://localhost:8000/v1/rails/configs | |
| # Add more tests here if needed | |
| # Stop and remove the container | |
| - name: Stop and remove container | |
| run: | | |
| docker stop test_container | |
| docker rm test_container |