ci: more granular test filtering and better testing structure #2
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: unit | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "sdks/community/go/**" | |
| - ".github/workflows/unit-go-sdk.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "sdks/community/go/**" | |
| - ".github/workflows/unit-go-sdk.yml" | |
| jobs: | |
| go: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24.4" | |
| - name: Setup Go module cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download dependencies | |
| working-directory: sdks/community/go | |
| run: go mod download | |
| - name: Run tests | |
| working-directory: sdks/community/go | |
| run: go test ./... -v |