Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,23 @@ jobs:
environment:
name: splunk-test-pypi
steps:
- name: Checkout source
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up Python ${{ env.PYTHON_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Setup uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
with:
version: 0.11.6
activate-environment: true
enable-cache: true
- name: Install dependencies
run: python -m pip install . --group build
run: SDK_DEPS_GROUP="release" make uv-sync-ci
- name: Build packages for distribution
run: python -m build
run: uv build
- name: Publish packages to Test PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ jobs:
environment:
name: splunk-pypi
steps:
- name: Checkout source
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up Python ${{ env.PYTHON_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Setup uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
with:
activate-environment: true
enable-cache: true
- name: Install dependencies
run: python -m pip install . --group release
run: SDK_DEPS_GROUP="release" make uv-sync-ci
- name: Build packages for distribution
run: python -m build
run: uv build
- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
- name: Generate API reference
Expand Down
50 changes: 30 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
name: Python CI
on: [push, workflow_dispatch]
name: Python SDK CI
on:
push:
branches: [master, develop]

jobs:
run-test-suite:
test-stage:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
splunk-version: [9.4, latest]
include:
# Oldest possible configuration
# Last Ubuntu version with Python 3.7 binaries available
- os: ubuntu-22.04
python-version: 3.7
splunk-version: 9.1
# Latest possible configuration
- os: ubuntu-latest
python-version: 3.13
splunk-version: latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Launch Splunk Docker instance
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}
- name: (Python 3.7) Install dependencies
if: ${{ matrix.python-version == '3.7' }}
run: python -m pip install python-dotenv pytest
- name: (Python >= 3.9) Install dependencies
if: ${{ matrix.python-version != '3.7' }}
run: python -m pip install . --group test
- name: Run entire test suite
run: python -m pytest ./tests
cache: pip
- name: Setup latest uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
with:
version: 0.11.6
activate-environment: true
enable-cache: true
- name: Install Python dependencies
run: SDK_DEPS_GROUP="test" make uv-sync-ci
- name: Launch Splunk Docker instance
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
- name: Set up `.env`
run: cp .env.template .env
- name: Restore `pytest` cache
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }}
uses: actions/cache@565629816435f6c0b50676926c9b05c254113c0c
with:
path: .pytest_cache
key: pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-
- name: Run unit tests
run: make test-unit
- name: Run integration/system tests
run: make test-integration