|
1 | 1 | name: Python SDK CI |
2 | | -on: |
3 | | - push: |
4 | | - branches: [master, develop] |
| 2 | +on: [push, workflow_dispatch] |
| 3 | + |
| 4 | +concurrency: |
| 5 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 6 | + cancel-in-progress: true |
5 | 7 |
|
6 | 8 | jobs: |
7 | 9 | test-stage: |
8 | 10 | runs-on: ${{ matrix.os }} |
9 | 11 | strategy: |
10 | 12 | matrix: |
11 | 13 | os: [ubuntu-latest] |
12 | | - python-version: [3.9] |
13 | | - splunk-version: [9.4, latest] |
14 | | - include: |
15 | | - - os: ubuntu-latest |
16 | | - python-version: 3.13 |
17 | | - splunk-version: latest |
| 14 | + python-version: [3.13] |
| 15 | + splunk-version: [latest] |
18 | 16 | steps: |
19 | | - - name: Checkout code |
20 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
21 | | - - name: Set up Python ${{ matrix.python-version }} |
22 | | - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 |
| 17 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| 18 | + - uses: ./.github/actions/setup-sdk-environment |
23 | 19 | with: |
24 | 20 | python-version: ${{ matrix.python-version }} |
25 | | - cache: pip |
26 | | - - name: Set up 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 |
| 21 | + deps-group: test |
| 22 | + - name: Download Splunk MCP Server App |
| 23 | + run: uv run ./scripts/download_splunk_mcp_server_app.py |
| 24 | + env: |
| 25 | + SPLUNKBASE_USERNAME: ${{ secrets.SPLUNKBASE_USERNAME }} |
| 26 | + SPLUNKBASE_PASSWORD: ${{ secrets.SPLUNKBASE_PASSWORD }} |
34 | 27 | - name: Launch Splunk Docker instance |
35 | 28 | run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d |
36 | | - - name: Set up `.env` |
| 29 | + - name: Set up .env |
37 | 30 | run: cp .env.template .env |
38 | | - - name: Restore `pytest` cache |
| 31 | + - name: Write internal AI secrets to .env |
| 32 | + run: | |
| 33 | + echo "internal_ai_app_key=$INTERNAL_AI_APP_KEY" >> .env |
| 34 | + echo "internal_ai_client_id=$INTERNAL_AI_CLIENT_ID" >> .env |
| 35 | + echo "internal_ai_client_secret=$INTERNAL_AI_CLIENT_SECRET" >> .env |
| 36 | + echo "internal_ai_token_url=$INTERNAL_AI_TOKEN_URL" >> .env |
| 37 | + echo "internal_ai_base_url=$INTERNAL_AI_BASE_URL" >> .env |
| 38 | + env: |
| 39 | + INTERNAL_AI_APP_KEY: ${{ secrets.INTERNAL_AI_APP_KEY }} |
| 40 | + INTERNAL_AI_CLIENT_ID: ${{ secrets.INTERNAL_AI_CLIENT_ID }} |
| 41 | + INTERNAL_AI_CLIENT_SECRET: ${{ secrets.INTERNAL_AI_CLIENT_SECRET }} |
| 42 | + INTERNAL_AI_TOKEN_URL: ${{ secrets.INTERNAL_AI_TOKEN_URL }} |
| 43 | + INTERNAL_AI_BASE_URL: ${{ secrets.INTERNAL_AI_BASE_URL }} |
| 44 | + - name: Restore pytest cache |
39 | 45 | if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }} |
40 | | - uses: actions/cache@565629816435f6c0b50676926c9b05c254113c0c |
| 46 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae |
41 | 47 | with: |
42 | 48 | path: .pytest_cache |
43 | 49 | key: pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.sha }} |
44 | 50 | restore-keys: | |
45 | 51 | pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}- |
46 | 52 | - name: Run unit tests |
47 | 53 | run: make test-unit |
48 | | - - name: Run integration/system tests |
| 54 | + - name: Run entire test suite |
49 | 55 | run: make test-integration |
0 commit comments