Skip to content

Commit a90feda

Browse files
fix: pin Python 3.9 and filter Splunk images (#428)
### Description Use `env` for Python version handling instead of `input` Update Poetry to latest version `2.1.4` Use `features` input for addonfactory-test-matrix-action to filter out non compatible Splunk versions ### Checklist - [ ] `README.md` has been updated or is not required - [ ] push trigger tests - [ ] manual release test - [ ] automated releases test - [x] pull request trigger tests - [ ] schedule trigger tests - [ ] workflow errors/warnings reviewed and addressed ### Testing done https://github.com/splunk/splunk-add-on-for-microsoft-office-365/actions/runs/16799304299
1 parent 32fdf1c commit a90feda

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ on:
5757
description: "Forces WFE tests to run only on the latest Splunk when set to true. When set to false - will run on all supported Splunk versions required for the release. When not set - default behavior."
5858
type: string
5959
default: "false"
60-
dev-python-version:
61-
required: false
62-
type: string
63-
default: "3.9"
6460
secrets:
6561
GH_TOKEN_ADMIN:
6662
description: Github admin token
@@ -107,6 +103,10 @@ permissions:
107103
concurrency:
108104
group: ${{ github.head_ref || github.run_id }}
109105
cancel-in-progress: true
106+
env:
107+
PYTHON_VERSION: "3.9"
108+
POETRY_VERSION: "2.1.4"
109+
POETRY_EXPORT_PLUGIN_VERSION: "1.9.0"
110110
jobs:
111111
validate-custom-version:
112112
runs-on: ubuntu-latest
@@ -304,7 +304,9 @@ jobs:
304304
submodules: false
305305
persist-credentials: false
306306
- id: matrix
307-
uses: splunk/addonfactory-test-matrix-action@v3.0
307+
uses: splunk/addonfactory-test-matrix-action@v3.1
308+
with:
309+
features: PYTHON39
308310
- id: determine_splunk
309311
env:
310312
wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }}
@@ -378,7 +380,7 @@ jobs:
378380
- uses: actions/checkout@v4
379381
- uses: actions/setup-python@v5
380382
with:
381-
python-version: ${{ inputs.dev-python-version }}
383+
python-version: ${{ env.PYTHON_VERSION }}
382384
- uses: pre-commit/action@v3.0.1
383385

384386
review_secrets:
@@ -434,7 +436,7 @@ jobs:
434436
find package/default/data -type d -name "spl2" -maxdepth 1 -mindepth 1 | sed 's|^package/default/data/||g' | while read -r TESTSET; do echo "$TESTSET=${{ needs.check-docs-changes.outputs.docs-only == 'false' && 'true' || 'false' }}" >> "$GITHUB_OUTPUT"; echo "$TESTSET::${{ needs.check-docs-changes.outputs.docs-only == 'false' && 'true' || 'false' }}"; done
435437
436438
run-unit-tests:
437-
name: test-unit-python-${{ inputs.dev-python-version }}
439+
name: run-unit-tests
438440
if: ${{ needs.test-inventory.outputs.unit == 'true' }}
439441
runs-on: ubuntu-22.04
440442
needs:
@@ -450,14 +452,14 @@ jobs:
450452
- uses: actions/checkout@v4
451453
- uses: actions/setup-python@v5
452454
with:
453-
python-version: ${{ inputs.dev-python-version }}
455+
python-version: ${{ env.PYTHON_VERSION }}
454456
- name: Setup addon
455457
run: |
456458
if [ -f "poetry.lock" ]
457459
then
458460
mkdir -p package/lib || true
459-
python${{ inputs.dev-python-version }} -m pip install poetry==1.5.1 poetry-plugin-export==1.4.0
460-
poetry lock --check
461+
python${{ env.PYTHON_VERSION }} -m pip install poetry==${{ env.POETRY_VERSION }} poetry-plugin-export==${{ env.POETRY_EXPORT_PLUGIN_VERSION }}
462+
poetry check
461463
poetry export --without-hashes -o package/lib/requirements.txt
462464
poetry export --without-hashes --with dev -o requirements_dev.txt
463465
fi
@@ -494,7 +496,7 @@ jobs:
494496
- uses: actions/upload-artifact@v4
495497
if: success() || failure()
496498
with:
497-
name: test-results-unit-python_${{ inputs.dev-python-version }}
499+
name: test-results-unit-python_${{ env.PYTHON_VERSION }}
498500
path: test-results/*
499501

500502
build:
@@ -526,13 +528,13 @@ jobs:
526528
- name: Setup python
527529
uses: actions/setup-python@v5
528530
with:
529-
python-version: ${{ inputs.dev-python-version }}
531+
python-version: ${{ env.PYTHON_VERSION }}
530532
- name: create requirements file for pip
531533
run: |
532534
if [ -f "poetry.lock" ]
533535
then
534536
echo " poetry.lock found "
535-
python${{ inputs.dev-python-version }} -m pip install poetry==1.5.1 poetry-plugin-export==1.4.0
537+
python${{ env.PYTHON_VERSION }} -m pip install poetry==${{ env.POETRY_VERSION }} poetry-plugin-export==${{ env.POETRY_EXPORT_PLUGIN_VERSION }}
536538
poetry export --without-hashes -o requirements.txt
537539
if [ "$(grep -cve '^\s*$' requirements.txt)" -ne 0 ]
538540
then
@@ -624,7 +626,7 @@ jobs:
624626
cp -f THIRDPARTY package/THIRDPARTY || echo "THIRDPARTY file not found (allowed for PR and schedule)"
625627
- name: Build Package
626628
id: uccgen
627-
uses: splunk/addonfactory-ucc-generator-action@v2
629+
uses: splunk/addonfactory-ucc-generator-action@v3.0
628630
with:
629631
version: ${{ steps.BuildVersion.outputs.VERSION }}
630632
- name: Slim Package
@@ -834,12 +836,12 @@ jobs:
834836
- name: Setup python
835837
uses: actions/setup-python@v5
836838
with:
837-
python-version: ${{ inputs.dev-python-version }}
839+
python-version: ${{ env.PYTHON_VERSION }}
838840
- name: setup-poetry
839841
id: setup-poetry
840842
shell: bash
841843
run: |
842-
python${{ inputs.dev-python-version }} -m pip install poetry==1.5.1
844+
python${{ env.PYTHON_VERSION }} -m pip install poetry==${{ env.POETRY_VERSION }}
843845
export POETRY_REPOSITORIES_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_URL=https://github.com/splunk/addonfactory-ucc-test.git
844846
export POETRY_HTTP_BASIC_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_USERNAME=${{ secrets.SA_GH_USER_NAME }}
845847
export POETRY_HTTP_BASIC_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_PASSWORD=${{ secrets.GH_TOKEN_ADMIN }}
@@ -905,7 +907,6 @@ jobs:
905907
SPLUNK_VERSION_BASE: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
906908
TEST_TYPE: "btool"
907909
TEST_ARGS: ""
908-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
909910
permissions:
910911
actions: read
911912
deployments: read
@@ -947,7 +948,7 @@ jobs:
947948
timeout-minutes: 10
948949
env:
949950
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
950-
uses: splunk/wfe-test-runner-action@v5.1
951+
uses: splunk/wfe-test-runner-action@v5.2
951952
with:
952953
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
953954
test-type: ${{ env.TEST_TYPE }}
@@ -1143,7 +1144,6 @@ jobs:
11431144
SPLUNK_VERSION_BASE: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
11441145
TEST_TYPE: "knowledge"
11451146
TEST_ARGS: ""
1146-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
11471147
permissions:
11481148
actions: read
11491149
deployments: read
@@ -1193,7 +1193,7 @@ jobs:
11931193
continue-on-error: true
11941194
env:
11951195
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
1196-
uses: splunk/wfe-test-runner-action@v5.1
1196+
uses: splunk/wfe-test-runner-action@v5.2
11971197
with:
11981198
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
11991199
test-type: ${{ env.TEST_TYPE }}
@@ -1417,7 +1417,6 @@ jobs:
14171417
TEST_TYPE: "ui"
14181418
TEST_ARGS: "--browser ${{ matrix.browser }} ${{ needs.setup-workflow.outputs.exit-first }}"
14191419
TEST_BROWSER: ${{ matrix.browser }}
1420-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
14211420
permissions:
14221421
actions: read
14231422
deployments: read
@@ -1479,7 +1478,7 @@ jobs:
14791478
continue-on-error: true
14801479
env:
14811480
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
1482-
uses: splunk/wfe-test-runner-action@v5.1
1481+
uses: splunk/wfe-test-runner-action@v5.2
14831482
with:
14841483
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
14851484
test-type: ${{ env.TEST_TYPE }}
@@ -1696,7 +1695,6 @@ jobs:
16961695
SPLUNK_VERSION_BASE: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
16971696
TEST_TYPE: "modinput_functional"
16981697
TEST_ARGS: ""
1699-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
17001698
permissions:
17011699
actions: read
17021700
deployments: read
@@ -1758,7 +1756,7 @@ jobs:
17581756
continue-on-error: true
17591757
env:
17601758
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
1761-
uses: splunk/wfe-test-runner-action@v5.1
1759+
uses: splunk/wfe-test-runner-action@v5.2
17621760
with:
17631761
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
17641762
test-type: ${{ env.TEST_TYPE }}
@@ -1973,7 +1971,6 @@ jobs:
19731971
SPLUNK_VERSION_BASE: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
19741972
TEST_TYPE: "ucc_modinput_functional"
19751973
TEST_ARGS: ""
1976-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
19771974
permissions:
19781975
actions: read
19791976
deployments: read
@@ -2035,7 +2032,7 @@ jobs:
20352032
continue-on-error: true
20362033
env:
20372034
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
2038-
uses: splunk/wfe-test-runner-action@v5.1
2035+
uses: splunk/wfe-test-runner-action@v5.2
20392036
with:
20402037
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
20412038
test-type: ${{ env.TEST_TYPE }}
@@ -2250,7 +2247,6 @@ jobs:
22502247
SPLUNK_VERSION_BASE: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
22512248
TEST_TYPE: "upgrade"
22522249
TEST_ARGS: ""
2253-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
22542250
permissions:
22552251
actions: read
22562252
deployments: read
@@ -2300,7 +2296,7 @@ jobs:
23002296
continue-on-error: true
23012297
env:
23022298
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
2303-
uses: splunk/wfe-test-runner-action@v5.1
2299+
uses: splunk/wfe-test-runner-action@v5.2
23042300
with:
23052301
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
23062302
test-type: ${{ env.TEST_TYPE }}
@@ -2514,7 +2510,6 @@ jobs:
25142510
ARGO_NAMESPACE: ${{ needs.setup.outputs.argo-namespace }}
25152511
SPLUNK_VERSION_BASE: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
25162512
TEST_TYPE: "scripted_inputs"
2517-
PYTHON_VERSION: ${{ inputs.dev-python-version }}
25182513
permissions:
25192514
actions: read
25202515
deployments: read
@@ -2577,7 +2572,7 @@ jobs:
25772572
continue-on-error: true
25782573
env:
25792574
ARGO_TOKEN: ${{ steps.get-argo-token.outputs.argo-token }}
2580-
uses: splunk/wfe-test-runner-action@v5.1
2575+
uses: splunk/wfe-test-runner-action@v5.2
25812576
with:
25822577
splunk: ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
25832578
test-type: ${{ env.TEST_TYPE }}

0 commit comments

Comments
 (0)