Skip to content

Commit

Permalink
enable macos unit tests
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706759813
  • Loading branch information
chunnienc authored and copybara-github committed Dec 16, 2024
1 parent 0704751 commit a13f4d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly_unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.sha }}
run-on-macos: true
23 changes: 20 additions & 3 deletions .github/workflows/unittests_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,31 @@ on:
trigger-sha:
required: true
type: string

run-on-macos:
type: boolean
default: true
jobs:
matrix-prep:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.set-matrix.outputs.matrix_os }}
steps:
- id: set-matrix
run: |
os=("Linux_runner_8_core")
if [[ "${{ inputs.run-on-macos }}" == "true" ]]; then
os+=("macos-latest" "macos-13")
fi
os=$(jq -c -n '$ARGS.positional' --args "${os[@]}")
echo "os: ${os}"
echo "matrix_os=${os}" >> $GITHUB_OUTPUT
test:
needs: matrix-prep
strategy:
matrix:
python-version: ["3.10", "3.11"]
runs-on:
labels: Linux_runner_8_core
os: ${{ fromJson(needs.matrix-prep.outputs.matrix_os) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit a13f4d4

Please sign in to comment.