Skip to content

Commit

Permalink
Improvements to scoped-tests action
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanotti committed Jan 10, 2025
1 parent 4d17daf commit 993bc75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/scoped-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ jobs:
- '**/*_test.go'
scoped-tests:
needs: changedfiles
if: needs.changedfiles.outputs.go_sources != '' || needs.changedfiles.outputs.go_tests != ''
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
runs-on: ${{ matrix.os }}
needs: changedfiles
steps:
- name: Echo changed files
shell: bash
Expand All @@ -59,9 +60,14 @@ jobs:
./.tools
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}

- name: Build test tools
- name: Build gotestsum on Windows
if: runner.os == 'Windows'
run: make "$(${PWD} -replace '\\', '/')/.tools/gotestsum"

- name: Build gotestsum
if: runner.os != 'Windows'
run: make "$PWD/.tools/gotestsum"

- name: Run changed tests
if: needs.changedfiles.outputs.go_tests
env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ for-affected-components:
if [ -z '$${DEPENDENT_PKGS}' ]; then \
echo "No other package depends on the one being changed."; \
else \
DEPENDENT_PKG_DIRS=$$(echo $${DEPENDENT_PKGS} | tr ' ' '\n' | xargs -I {} grep --include=go.mod -rl {} | xargs dirname | uniq); \
DEPENDENT_PKG_DIRS=$$(echo $${DEPENDENT_PKGS} | tr ' ' '\n' | xargs -I {} grep --include=go.mod -rl {} | xargs -r dirname | uniq); \
set -e; for dir in $$(echo $${DEPENDENT_PKG_DIRS}); do \
(cd "$${dir}" && \
echo "running $${CMD} in $${dir}" && \
Expand Down

0 comments on commit 993bc75

Please sign in to comment.