feat: add receiver for redfish #22085
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: scoped-test | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
permissions: read-all | |
jobs: | |
changedfiles: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
env: | |
PR_HEAD: ${{ github.event.pull_request.head.sha }} | |
outputs: | |
go_sources: ${{ steps.changes.outputs.go_sources }} | |
go_tests: ${{ steps.changes.outputs.go_tests }} | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
with: | |
fetch-depth: 0 | |
- name: Get changes | |
shell: bash | |
id: changes | |
env: | |
PR_HEAD: ${{ github.event.pull_request.head.sha }} | |
run: | | |
changed_files="$(git diff --name-only --diff-filter=ACMRTUXB "$(git merge-base origin/main "$PR_HEAD")" "$PR_HEAD")" | |
echo changed_files | |
echo "$changed_files" | |
go_sources=$(echo "$changed_files" | tr ' ' '\n' | grep -E '\.go$' | grep -v -E '.*_test\.go$' || true) | |
echo go_sources | |
echo "$go_sources" | |
if [[ -n "$go_sources" ]]; then | |
{ | |
echo 'go_sources<<EOF' | |
echo "$go_sources" | |
echo EOF | |
} >> "$GITHUB_OUTPUT" | |
fi | |
go_tests=$(echo "$changed_files" | tr ' ' '\n' | grep -E '.*_test\.go$' || true) | |
echo go_tests | |
echo "$go_tests" | |
if [[ -n "$go_tests" ]]; then | |
{ | |
echo 'go_tests<<EOF' | |
echo "$go_tests" | |
echo EOF | |
} >> "$GITHUB_OUTPUT" | |
fi | |
scoped-tests-matrix: | |
needs: changedfiles | |
if: needs.changedfiles.outputs.go_sources != '' || needs.changedfiles.outputs.go_tests != '' | |
strategy: | |
matrix: | |
runner: [windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: Echo changed files | |
shell: bash | |
run: | | |
echo "go_sources: ${{ needs.changedfiles.outputs.go_sources }}" | |
echo "go_tests: ${{ needs.changedfiles.outputs.go_tests }}" | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
id: go-setup | |
with: | |
go-version: oldstable | |
cache-dependency-path: "**/*.sum" | |
- name: Install dependencies | |
if: steps.go-setup.outputs.cache-hit != 'true' | |
run: make -j2 gomoddownload | |
- name: Install Tools | |
if: steps.go-setup.outputs.cache-hit != 'true' | |
run: make install-tools | |
- name: Build gotestsum | |
shell: bash | |
run: make "$PWD/.tools/gotestsum" | |
- name: Run changed tests | |
if: needs.changedfiles.outputs.go_tests | |
env: | |
CHANGED_GOLANG_TESTS: ${{ needs.changedfiles.outputs.go_tests }} | |
run: | | |
make run-changed-tests | |
- name: Run tests on dependent components | |
if: needs.changedfiles.outputs.go_sources | |
env: | |
CHANGED_GOLANG_SOURCES: ${{ needs.changedfiles.outputs.go_sources }} | |
run: | | |
make for-affected-components CMD="make lint test-twice" | |
scoped-tests: | |
# Keeps the name of the job required for merging in the GH configuration, make it | |
# wait for all runners completion | |
runs-on: ubuntu-24.04 | |
needs: [scoped-tests-matrix] | |
steps: | |
- name: Print result | |
run: echo ${{ needs.scoped-tests-matrix.result }} | |
- name: Interpret result | |
run: | | |
if [[ success == ${{ needs.scoped-tests-matrix.result }} ]] | |
then | |
echo "All matrix jobs passed!" | |
else | |
echo "One or more matrix jobs failed." | |
false | |
fi |