Skip to content

Commit bf50fc9

Browse files
committed
Upstream updates to some workflows
1 parent e4d76a2 commit bf50fc9

File tree

3 files changed

+51
-28
lines changed

3 files changed

+51
-28
lines changed

.github/workflows/pre-release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@ jobs:
1212
environment:
1313
name: splunk-test-pypi
1414
steps:
15-
- name: Checkout source
15+
- name: Checkout code
1616
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
17-
- name: Set up Python ${{ env.PYTHON_VERSION }}
17+
- name: Setup Python ${{ env.PYTHON_VERSION }}
1818
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
1919
with:
2020
python-version: ${{ env.PYTHON_VERSION }}
21+
cache: pip
22+
- name: Setup uv
23+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
24+
with:
25+
version: 0.11.6
26+
activate-environment: true
27+
enable-cache: true
2128
- name: Install dependencies
22-
run: python -m pip install . --group build
29+
run: SDK_DEPS_GROUP="release" make uv-sync-ci
2330
- name: Build packages for distribution
24-
run: python -m build
31+
run: uv build
2532
- name: Publish packages to Test PyPI
2633
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
2734
with:

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@ jobs:
1414
environment:
1515
name: splunk-pypi
1616
steps:
17-
- name: Checkout source
17+
- name: Checkout code
1818
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
19-
- name: Set up Python ${{ env.PYTHON_VERSION }}
19+
- name: Setup Python ${{ env.PYTHON_VERSION }}
2020
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
2121
with:
2222
python-version: ${{ env.PYTHON_VERSION }}
23+
cache: pip
24+
- name: Setup uv
25+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
26+
with:
27+
activate-environment: true
28+
enable-cache: true
2329
- name: Install dependencies
24-
run: python -m pip install . --group release
30+
run: SDK_DEPS_GROUP="release" make uv-sync-ci
2531
- name: Build packages for distribution
26-
run: python -m build
32+
run: uv build
2733
- name: Publish packages to PyPI
2834
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
2935
- name: Generate API reference

.github/workflows/test.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
1-
name: Python CI
2-
on: [push, workflow_dispatch]
1+
name: Python SDK CI
2+
on:
3+
push:
4+
branches: [master, develop]
35

46
jobs:
5-
run-test-suite:
7+
test-stage:
68
runs-on: ${{ matrix.os }}
79
strategy:
8-
fail-fast: false
910
matrix:
1011
os: [ubuntu-latest]
1112
python-version: [3.9]
1213
splunk-version: [9.4, latest]
1314
include:
14-
# Oldest possible configuration
15-
# Last Ubuntu version with Python 3.7 binaries available
16-
- os: ubuntu-22.04
17-
python-version: 3.7
18-
splunk-version: 9.1
19-
# Latest possible configuration
2015
- os: ubuntu-latest
2116
python-version: 3.13
2217
splunk-version: latest
2318
steps:
2419
- name: Checkout code
2520
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
26-
- name: Launch Splunk Docker instance
27-
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
2821
- name: Setup Python ${{ matrix.python-version }}
2922
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
3023
with:
3124
python-version: ${{ matrix.python-version }}
32-
- name: (Python 3.7) Install dependencies
33-
if: ${{ matrix.python-version == '3.7' }}
34-
run: python -m pip install python-dotenv pytest
35-
- name: (Python >= 3.9) Install dependencies
36-
if: ${{ matrix.python-version != '3.7' }}
37-
run: python -m pip install . --group test
38-
- name: Run entire test suite
39-
run: python -m pytest ./tests
25+
cache: pip
26+
- name: Setup latest uv
27+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
28+
with:
29+
version: 0.11.6
30+
activate-environment: true
31+
enable-cache: true
32+
- name: Install Python dependencies
33+
run: SDK_DEPS_GROUP="test" make uv-sync-ci
34+
- name: Launch Splunk Docker instance
35+
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
36+
- name: Set up `.env`
37+
run: cp .env.template .env
38+
- name: Restore `pytest` cache
39+
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }}
40+
uses: actions/cache@565629816435f6c0b50676926c9b05c254113c0c
41+
with:
42+
path: .pytest_cache
43+
key: pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.sha }}
44+
restore-keys: |
45+
pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-
46+
- name: Run unit tests
47+
run: make test-unit
48+
- name: Run integration/system tests
49+
run: make test-integration

0 commit comments

Comments
 (0)