Skip to content

fix: wfe tests run on splunk latest #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2025
Merged
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
14 changes: 12 additions & 2 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ on:
type: string
default: >-
[""]
wfe-run-on-splunk-latest:
required: false
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."
type: string
default: ""
secrets:
GH_TOKEN_ADMIN:
description: Github admin token
Expand Down Expand Up @@ -269,15 +274,20 @@ jobs:
- id: matrix
uses: splunk/addonfactory-test-matrix-action@v3.0
- id: determine_splunk
env:
wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }}
run: |
if [ "${{ github.event_name }}" == "schedule" ]; then
if [[ "$wfe_run_on_splunk_latest" == "" ]]; then
wfe_run_on_splunk_latest="${{ github.event_name == 'schedule' || !((github.base_ref == 'main' || github.ref_name == 'main') || ((github.base_ref == 'develop' || github.ref_name == 'develop') && github.event_name == 'push')) }}"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionally consider having:

wfe_run_on_splunk_all: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'develop')) || (github.event_name == 'pull_request' && github.base_ref == 'main') }}

wfe_run_on_splunk_latest: ${{ github.event_name == 'schedule' || !(wfe_run_on_splunk_all) }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ thats invalid code. My bash version did not look better :)

if [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
echo "matrixSplunk=${{ toJson(steps.matrix.outputs.latestSplunk) }}" >> "$GITHUB_OUTPUT"
else
echo "matrixSplunk=${{toJson(steps.matrix.outputs.supportedSplunk) }}" >> "$GITHUB_OUTPUT"
fi
- name: job summary
run: |
splunk_version_list=$(echo '${{ steps.matrix.outputs.supportedSplunk }}' | jq -r '.[].version')
splunk_version_list=$(echo '${{ steps.determine_splunk.outputs.matrixSplunk }}' | jq -r '.[].version')
sc4s_version_list=$(echo '${{ steps.matrix.outputs.supportedSC4S }}' | jq -r '.[].version')
echo -e "## Summary of Versions Used\n- **Splunk versions used:** (${splunk_version_list})\n- **SC4S versions used:** (${sc4s_version_list})\n- Browser: Chrome" >> "$GITHUB_STEP_SUMMARY"
fossa-scan:
Expand Down
Loading