[chore] update semconv #25739
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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changes | |
| shell: bash | |
| id: changes | |
| env: | |
| PR_HEAD: ${{ github.event.pull_request.head.sha }} | |
| # Skip scoped tests if too many files are changed | |
| 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" | |
| LIMIT=50 | |
| 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 | |
| count=$(echo "$go_sources" | wc -l) | |
| if [ "$count" -gt "$LIMIT" ]; then | |
| echo "Skipping scoped go_sources: This PR modified $count .go files which is over the $LIMIT files threshold." | |
| else | |
| { | |
| echo 'go_sources<<EOF' | |
| echo "$go_sources" | |
| echo EOF | |
| } >> "$GITHUB_OUTPUT" | |
| fi | |
| fi | |
| go_tests=$(echo "$changed_files" | tr ' ' '\n' | grep -E '.*_test\.go$' || true) | |
| echo go_tests | |
| echo "$go_tests" | |
| if [[ -n "$go_tests" ]]; then | |
| count=$(echo "$go_tests" | wc -l) | |
| if [ "$count" -gt "$LIMIT" ]; then | |
| echo "Skipping scoped go_tests: This PR modified $count test files which is over the $LIMIT files threshold." | |
| else | |
| { | |
| echo 'go_tests<<EOF' | |
| echo "$go_tests" | |
| echo EOF | |
| } >> "$GITHUB_OUTPUT" | |
| fi | |
| fi | |
| scoped-tests-matrix: | |
| needs: changedfiles | |
| if: needs.changedfiles.outputs.go_sources != '' || needs.changedfiles.outputs.go_tests != '' | |
| strategy: | |
| matrix: | |
| runner: [windows-2022, windows-2025, windows-11-arm, ubuntu-latest] | |
| runs-on: ${{ matrix.runner }} | |
| env: | |
| # The gcc installed on the Windows arm64 runner doesn't ship native ARM libraries so we need to disable CGO. | |
| CGO_ENABLED: ${{ matrix.runner == 'windows-11-arm' && '0' || '' }} | |
| 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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6 | |
| - run: ./.github/workflows/scripts/free-disk-space.sh | |
| - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # 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 }} | |
| shell: bash | |
| # Only run linter on windows-2025 to avoid redundant runs | |
| run: | | |
| if [[ "${{ matrix.runner }}" == "windows-2025" ]]; then | |
| make for-affected-components CMD="make lint test-twice" | |
| else | |
| make for-affected-components CMD="make test-twice" | |
| fi | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| 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 |