update all packages #64
This file contains 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: Go | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
dind: | |
image: docker:23.0-rc-dind-rootless | |
ports: | |
- 2375:2375 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20' | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Install dependencies and run tests | |
run: | | |
# Find all directories containing go.mod files, excluding the root directory | |
modules=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \;) | |
# Run go test for each module | |
for module in $modules; do | |
echo "Running tests for module: $module" | |
(cd $module && go mod tidy && go test ./...) | |
done |