test: add GitHub Actions workflow for Docker integration tests #5
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
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: "Docker Integration Tests" | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| docker-integration-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build runtime image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| target: runtime | |
| tags: aiperf:test | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build env-builder stage (for uv) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| target: env-builder | |
| tags: aiperf:env-builder | |
| load: true | |
| cache-from: type=gha | |
| - name: Copy uv from env-builder to host | |
| run: | | |
| docker create --name uv-container aiperf:env-builder | |
| docker cp uv-container:/bin/uv ./uv | |
| docker rm uv-container | |
| chmod +x ./uv | |
| - name: Run integration tests in container | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -v ${{ github.workspace }}/uv:/usr/local/bin/uv:ro \ | |
| -w /workspace \ | |
| aiperf:test \ | |
| "uv pip install pytest pytest-xdist pytest-asyncio pytest-cov && \ | |
| uv pip install -e 'tests/aiperf_mock_server[dev]' && \ | |
| /opt/aiperf/venv/bin/pytest tests/integration/ -m 'integration and not performance and not stress' -n auto -v --tb=long" |