From 352ed30f9517e7e9b065586a4c19b8592df6dd8e Mon Sep 17 00:00:00 2001 From: adityamehra Date: Mon, 8 Jun 2026 12:42:09 -0700 Subject: [PATCH] ci: add test workflow across Python 3.10-3.13 and all OSes Adds a CI test workflow based on galileo-python's test.yaml with the following adaptations: - Removed codecov upload (no codecov token configured) - Added fail-fast: false so all matrix jobs run even if one fails - Added if: always() on type-check and test steps to match splunk-otel-python-contrib's ci-main.yaml failure/success semantics - Removed Python 3.14 to align with splunk-otel-python-contrib matrix - Pinned GitHub Action references to SHA hashes - Added concurrency group to cancel stale runs on new pushes Co-authored-by: Cursor --- .github/workflows/ci-tests.yaml | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ci-tests.yaml diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml new file mode 100644 index 00000000..e6f1f530 --- /dev/null +++ b/.github/workflows/ci-tests.yaml @@ -0,0 +1,62 @@ +name: CI - Test + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" + +jobs: + test: + name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.10", "3.11", "3.12", "3.13"] + + runs-on: ${{ matrix.os }} + # Hard cap per matrix job — bail out fast on real hangs instead of + # burning CI minutes up to the GitHub-default 6h ceiling. + timeout-minutes: 30 + + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Enable long paths on Windows + if: runner.os == 'Windows' + run: git config --system core.longpaths true + + - name: Install poetry + run: pipx install poetry==2.1.3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 + with: + cache: "poetry" + python-version: ${{ matrix.python-version }} + cache-dependency-path: "pyproject.toml" + + - name: Install invoke + run: pipx install invoke + + - name: Install Dependencies + run: invoke install + + - name: Validate Types + if: always() + run: invoke type-check + + - name: Run Tests + if: always() + run: invoke test-report-xml