Bump the github-actions group across 1 directory with 2 updates #1915
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # Run on all PRs, not just those targeting main | |
| # This enables CI for stacked PRs | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: pyproject.toml | |
| - name: Install dependencies | |
| run: make install-dev | |
| - name: Check lint | |
| run: make check-lint | |
| - name: Check format | |
| run: make check-format | |
| - name: Check types | |
| run: make check-types | |
| - name: Check deps | |
| run: make check-deps | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: pyproject.toml | |
| - name: Install dependencies | |
| run: make install-dev | |
| - name: Start Kafka with devservices | |
| run: | | |
| .venv/bin/devservices up --mode default | |
| echo "Waiting for Kafka to be ready..." | |
| KAFKA_READY=false | |
| for i in {1..30}; do | |
| KAFKA_CONTAINER=$(docker ps -qf "name=kafka") | |
| if [ -z "$KAFKA_CONTAINER" ]; then | |
| echo "Waiting for Kafka container to start... attempt $i/30" | |
| sleep 2 | |
| continue | |
| fi | |
| HEALTH_STATUS=$(docker inspect --format='{{.State.Health.Status}}' $KAFKA_CONTAINER 2>/dev/null || echo "none") | |
| if [ "$HEALTH_STATUS" = "healthy" ]; then | |
| echo "Kafka is ready!" | |
| KAFKA_READY=true | |
| break | |
| fi | |
| echo "Waiting for Kafka health check (status: $HEALTH_STATUS)... attempt $i/30" | |
| sleep 2 | |
| done | |
| if [ "$KAFKA_READY" = "false" ]; then | |
| echo "ERROR: Kafka failed to become healthy after 60 seconds" | |
| echo "=== Docker containers ===" | |
| docker ps -a | |
| echo "=== Kafka logs ===" | |
| docker logs $(docker ps -aqf "name=kafka") --tail 100 || echo "Could not get Kafka logs" | |
| exit 1 | |
| fi | |
| docker ps | |
| - name: Build Docker image with test fixtures | |
| run: docker build --build-arg TEST_BUILD=true -t launchpad-test . | |
| - name: Run all tests in Docker | |
| run: | | |
| # Get Kafka container info for network connectivity | |
| KAFKA_CONTAINER=$(docker ps -qf "name=kafka") | |
| KAFKA_NETWORK=$(docker inspect $KAFKA_CONTAINER --format='{{range $net,$v := .NetworkSettings.Networks}}{{$net}}{{end}}') | |
| docker run --rm \ | |
| --network $KAFKA_NETWORK \ | |
| -e LAUNCHPAD_ENV=development \ | |
| -e LAUNCHPAD_HOST=localhost \ | |
| -e LAUNCHPAD_PORT=2218 \ | |
| -e LAUNCHPAD_RPC_SHARED_SECRET="launchpad-test-secret" \ | |
| -e KAFKA_BOOTSTRAP_SERVERS="kafka:9093" \ | |
| -e KAFKA_GROUP_ID="launchpad-test-ci" \ | |
| -e KAFKA_TOPICS="preprod-artifact-events" \ | |
| launchpad-test python -m pytest -n auto tests/ -v | |
| - name: Show Kafka logs on failure | |
| if: failure() | |
| run: | | |
| if docker ps -qf "name=kafka" >/dev/null 2>&1; then | |
| echo "=== Kafka logs ===" | |
| docker logs $(docker ps -qf "name=kafka") --tail 100 | |
| fi | |
| - name: Test CLI installation and basic functionality in Docker | |
| run: | | |
| docker run --rm \ | |
| -e LAUNCHPAD_ENV=development \ | |
| -e LAUNCHPAD_HOST=localhost \ | |
| -e LAUNCHPAD_PORT=2218 \ | |
| launchpad-test launchpad --help | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: pyproject.toml | |
| - name: Install dependencies | |
| run: make install-dev | |
| - name: Start Kafka with devservices | |
| run: | | |
| .venv/bin/devservices up --mode default | |
| echo "Waiting for Kafka to be ready..." | |
| KAFKA_READY=false | |
| for i in {1..30}; do | |
| KAFKA_CONTAINER=$(docker ps -qf "name=kafka") | |
| if [ -z "$KAFKA_CONTAINER" ]; then | |
| echo "Waiting for Kafka container to start... attempt $i/30" | |
| sleep 2 | |
| continue | |
| fi | |
| HEALTH_STATUS=$(docker inspect --format='{{.State.Health.Status}}' $KAFKA_CONTAINER 2>/dev/null || echo "none") | |
| if [ "$HEALTH_STATUS" = "healthy" ]; then | |
| echo "Kafka is ready!" | |
| KAFKA_READY=true | |
| break | |
| fi | |
| echo "Waiting for Kafka health check (status: $HEALTH_STATUS)... attempt $i/30" | |
| sleep 2 | |
| done | |
| if [ "$KAFKA_READY" = "false" ]; then | |
| echo "ERROR: Kafka failed to become healthy after 60 seconds" | |
| echo "=== Docker containers ===" | |
| docker ps -a | |
| echo "=== Kafka logs ===" | |
| docker logs $(docker ps -aqf "name=kafka") --tail 100 || echo "Could not get Kafka logs" | |
| exit 1 | |
| fi | |
| docker ps | |
| - name: Build Docker image with test fixtures | |
| run: docker build --build-arg TEST_BUILD=true -t launchpad-test . | |
| - name: Run coverage in Docker | |
| run: | | |
| # Get Kafka container info for network connectivity | |
| KAFKA_CONTAINER=$(docker ps -qf "name=kafka") | |
| KAFKA_NETWORK=$(docker inspect $KAFKA_CONTAINER --format='{{range $net,$v := .NetworkSettings.Networks}}{{$net}}{{end}}') | |
| docker run --rm \ | |
| --network $KAFKA_NETWORK \ | |
| -e LAUNCHPAD_ENV=development \ | |
| -e LAUNCHPAD_HOST=localhost \ | |
| -e LAUNCHPAD_PORT=2218 \ | |
| -e LAUNCHPAD_RPC_SHARED_SECRET="launchpad-test-secret" \ | |
| -e KAFKA_BOOTSTRAP_SERVERS="kafka:9093" \ | |
| -e KAFKA_GROUP_ID="launchpad-test-coverage" \ | |
| -e KAFKA_TOPICS="preprod-artifact-events" \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -w /workspace \ | |
| --user $(id -u):$(id -g) \ | |
| launchpad-test python -m pytest -n auto tests/unit/ tests/integration/ -v --cov --cov-branch --cov-report=xml --junitxml=junit.xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: getsentry/launchpad | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: junit.xml | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [check, test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: pyproject.toml | |
| - name: Install dependencies | |
| run: make install-dev | |
| - name: Build package | |
| run: make build | |
| - name: Verify build artifacts | |
| run: | | |
| ls -la dist/ | |
| # Create a fresh venv for testing the wheel installation | |
| python -m venv test-venv | |
| test-venv/bin/pip install dist/*.whl | |
| # Install dependencies that the package needs | |
| test-venv/bin/pip install -r requirements.txt | |
| test-venv/bin/launchpad --help | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| retention-days: 7 |