ci: add macos and windows unit tests (#675)

This commit is contained in:
Yuan
2025-06-18 14:22:00 -07:00
committed by GitHub
parent ef6e3f1c32
commit e3844ff76d
2 changed files with 11 additions and 3 deletions

View File

@@ -31,6 +31,8 @@ branchProtectionRules:
- "header-check"
# - Add required status checks like presubmit tests
- "unit tests (ubuntu-latest)"
- "unit tests (windows-latest)"
- "unit tests (macos-latest)"
- "integration-test-pr (toolbox-testing-438616)"
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true

View File

@@ -32,8 +32,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [macos-latest, windows-latest, ubuntu-latest]
os: [ubuntu-latest]
os: [macos-latest, windows-latest, ubuntu-latest]
fail-fast: false
permissions:
contents: 'read'
@@ -75,7 +74,8 @@ jobs:
- name: Build
run: go build -v ./...
- name: Run tests
- name: Run tests with coverage
if: ${{ runner.os == 'Linux' }}
run: |
source_dir="./internal/sources/*"
tool_dir="./internal/tools/*"
@@ -85,7 +85,13 @@ jobs:
go test -race -cover -coverprofile=coverage.out -v $included_packages
go test -race -v ./internal/sources/... ./internal/tools/... ./internal/auth/...
- name: Run tests without coverage
if: ${{ runner.os != 'Linux' }}
run: |
go test -race -v ./internal/... ./cmd/...
- name: Check coverage
if: ${{ runner.os == 'Linux' }}
run: |
FILE_TO_EXCLUDE="github.com/googleapis/genai-toolbox/internal/server/config.go"
ESCAPED_PATH=$(echo "$FILE_TO_EXCLUDE" | sed 's/\//\\\//g; s/\./\\\./g')