Skip to content

Commit

Permalink
enable macos unit tests
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706845110
  • Loading branch information
chunnienc authored and copybara-github committed Dec 16, 2024
1 parent 0704751 commit fc9c986
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.sha }}
run-on-macos: true

build-and-release-nightly:
needs: run-unittests-python
Expand Down
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
1 change: 1 addition & 0 deletions .github/workflows/run_post_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ jobs:
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.event.after }}
run-on-macos: false
1 change: 1 addition & 0 deletions .github/workflows/run_pre_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
run-on-macos: false

run-model-coverage:
name: Model Coverage
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/unittests_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,34 @@ on:
workflow_call:
inputs:
trigger-sha:
required: true
type: string

required: true
run-on-macos:
type: boolean
default: false
jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.set-matrix.outputs.os }}
steps:
- name: Set matrix
id: set-matrix
run: |
os=("Linux_runner_8_core")
if [[ "${{ inputs.run-on-macos }}" == "true" ]]; then
os+=("macos-latest")
fi
os=$(jq -c -n '$ARGS.positional' --args "${os[@]}")
echo "os=${os}"
echo "os=${os}" >> $GITHUB_OUTPUT
test:
needs: prepare-matrix
strategy:
matrix:
python-version: ["3.10", "3.11"]
runs-on:
labels: Linux_runner_8_core
os: ${{ fromJson(needs.prepare-matrix.outputs.os) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
Expand Down
9 changes: 3 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
-f https://download.pytorch.org/whl/torch/
torch==2.5.1+cpu
-f https://download.pytorch.org/whl/torchvision/
torchvision==0.20.1+cpu
-f https://download.pytorch.org/whl/torchaudio/
torchaudio==2.5.1+cpu
torch==2.5.1
torchvision==0.20.1
torchaudio==2.5.1
--pre
tf-nightly>=2.19.0.dev20241201
ai-edge-litert-nightly
Expand Down

0 comments on commit fc9c986

Please sign in to comment.