Skip to content

Remove the traceback when a timeout error occurs #469

Remove the traceback when a timeout error occurs

Remove the traceback when a timeout error occurs #469

Workflow file for this run

name: Code Quality
on:
pull_request:
types:
- opened
- synchronize
- reopened
permissions:
contents: read
jobs:
lock-file:
name: 🧷 Prepare Locked Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv lock --locked
linting:
name: 🔍 Lint Code with Ruff
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv run --all-extras ruff check .
formatting:
name: 🧹 Check Code Formatting
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv run --all-extras ruff format --check .
type-consistency:
name: 🧠 Check Type Consistency
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install the project
run: uv sync
- run: uv run --all-extras pyright .
inclusive-language:
name: 🔤 Inclusive Language Check
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Run Inclusive Language Check
uses: get-woke/woke-action@v0
with:
fail-on-error: true
unit-tests:
name: 🧪 Unit Tests on ${{ matrix.os }} / Python ${{ matrix.python-version }}${{ matrix.experimental && ' (Experimental)' || '' }}
runs-on: macos-latest
needs: [lock-file]
permissions:
contents: read
statuses: write
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
experimental: [false]
# include:
# - os: macos-latest
# python-version: "3.15"
# experimental: true
# - os: ubuntu-latest
# python-version: "3.15"
# experimental: true
# - os: windows-latest
# python-version: "3.15"
# experimental: true
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Run tests with pytest
run: uv run --all-extras --python ${{ matrix.python-version }} pytest -n auto tests/unit
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
s3-integration-tests:
name: "🧪 Integration Test: S3 Emulator (Python ${{ matrix.python-version }})"
runs-on: ubuntu-latest
needs: [lock-file]
timeout-minutes: 10
strategy:
fail-fast: false # Allows all matrix jobs to run even if one fails
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- cloud_provider: s3
install_extras: s3
test_path: tests/integration/test_s3.py
services:
localstack:
image: localstack/localstack:latest
env:
SERVICES: s3
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
EAGER_SERVICE_LOADING: "1"
ENDPOINT_PROTO: https
LOCALSTACK_SSL: "1"
LS_LOG: warn
SKIP_INFRA_DOWNLOADS: "1"
ports:
- 4566:4566
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Wait for LocalStack to be ready
run: |
for i in {1..20}; do
if curl -sk https://localhost.localstack.cloud:4566/_localstack/health \
| grep '"s3": "running"' > /dev/null; then
echo "LocalStack S3 ready!"
exit 0
fi
echo "Waiting for LocalStack S3..."
sleep 1
done
echo "LocalStack failed to start in time" >&2
exit 1
- name: Run Pytest for S3 Cache
env:
AWS_ENDPOINT_URL: https://localhost.localstack.cloud:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
run: uv run --extra ${{ matrix.install_extras }} pytest ${{ matrix.test_path }} --no-cov
azure-integration-tests:
name: "🧪 Integration Test: Azure Emulator (Python ${{ matrix.python-version }})"
runs-on: ubuntu-latest
needs: [lock-file]
timeout-minutes: 10
strategy:
fail-fast: false # Allows all matrix jobs to run even if one fails
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- cloud_provider: azure
install_extras: azure
test_path: tests/integration/test_azure.py
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Download mkcert
run: |
curl -Ls "https://dl.filippo.io/mkcert/latest?for=linux/amd64" -o mkcert
chmod +x mkcert
sudo mv mkcert /usr/local/bin/
- name: Create local CA
run: mkcert -install
- name: Generate HTTPS cert for Azurite
run: mkcert 127.0.0.1
- name: Install Azurite
run: npm install -g azurite
- name: Start Azurite
run: |
azurite --oauth basic --cert 127.0.0.1.pem --key 127.0.0.1-key.pem --silent &
- name: Wait for Azurite to be ready
run: |
for i in {1..30}; do
if curl -ks https://127.0.0.1:10000/devstoreaccount1; then
echo "Azurite is ready"
break
fi
sleep 1
done
- name: Run Pytest for Azure Cache
env:
AZURE_ACCOUNT_URL: https://127.0.0.1:10000/devstoreaccount1
run: uv run --extra ${{ matrix.install_extras }} pytest ${{ matrix.test_path }} --no-cov
gcs-integration-tests:
name: "🧪 Integration Test: GCS Emulator (Python ${{ matrix.python-version }})"
runs-on: ubuntu-latest
needs: [lock-file]
timeout-minutes: 10
strategy:
fail-fast: false # Allows all matrix jobs to run even if one fails
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- cloud_provider: gcs
install_extras: gcs
test_path: tests/integration/test_gcs.py
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Start Fake GCS Server
uses: fsouza/[email protected]
with:
backend: memory
external-url: http://127.0.0.1:4443
scheme: http
- name: Wait for Fake GCS Server to be ready
run: |
for i in {1..20}; do
if curl -s http://127.0.0.1:4443/storage/v1/b >/dev/null; then
echo "Fake GCS Server is up!"
exit 0
fi
echo "Waiting for Fake GCS Server..."
sleep 1
done
echo "Fake GCS Server failed to start" >&2
exit 1
- name: Run Pytest for GCS Cache
env:
STORAGE_EMULATOR_HOST: http://127.0.0.1:4443
GOOGLE_CLOUD_PROJECT: cloud-autopkg-runner
run: uv run --extra ${{ matrix.install_extras }} pytest ${{ matrix.test_path }} --no-cov
build-and-install:
name: "📦 Build & Install Project Wheel"
runs-on: ubuntu-latest
needs:
[
lock-file,
linting,
formatting,
type-consistency,
inclusive-language,
unit-tests,
s3-integration-tests,
azure-integration-tests,
gcs-integration-tests,
]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Build project wheel
run: uv build
- name: Create virtual environment
run: uv venv
- name: Install project from wheel
run: |
uv pip install dist/*.whl
- name: Verify project installation
run: uv run python -c "import cloud_autopkg_runner"