Skip to content

Commit fc9c986

Browse files
chunnienccopybara-github
authored andcommitted
enable macos unit tests
PiperOrigin-RevId: 706845110
1 parent 0704751 commit fc9c986

File tree

6 files changed

+29
-10
lines changed

6 files changed

+29
-10
lines changed

.github/workflows/nightly_release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
uses: ./.github/workflows/unittests_python.yml
2121
with:
2222
trigger-sha: ${{ github.sha }}
23+
run-on-macos: true
2324

2425
build-and-release-nightly:
2526
needs: run-unittests-python

.github/workflows/nightly_unittests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ jobs:
2020
uses: ./.github/workflows/unittests_python.yml
2121
with:
2222
trigger-sha: ${{ github.sha }}
23+
run-on-macos: true

.github/workflows/run_post_merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ jobs:
2828
uses: ./.github/workflows/unittests_python.yml
2929
with:
3030
trigger-sha: ${{ github.event.after }}
31+
run-on-macos: false

.github/workflows/run_pre_merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
uses: ./.github/workflows/unittests_python.yml
6565
with:
6666
trigger-sha: ${{ github.event.pull_request.head.sha }}
67+
run-on-macos: false
6768

6869
run-model-coverage:
6970
name: Model Coverage

.github/workflows/unittests_python.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,34 @@ on:
1212
workflow_call:
1313
inputs:
1414
trigger-sha:
15-
required: true
1615
type: string
17-
16+
required: true
17+
run-on-macos:
18+
type: boolean
19+
default: false
1820
jobs:
21+
prepare-matrix:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
os: ${{ steps.set-matrix.outputs.os }}
25+
steps:
26+
- name: Set matrix
27+
id: set-matrix
28+
run: |
29+
os=("Linux_runner_8_core")
30+
if [[ "${{ inputs.run-on-macos }}" == "true" ]]; then
31+
os+=("macos-latest")
32+
fi
33+
os=$(jq -c -n '$ARGS.positional' --args "${os[@]}")
34+
echo "os=${os}"
35+
echo "os=${os}" >> $GITHUB_OUTPUT
1936
test:
37+
needs: prepare-matrix
2038
strategy:
2139
matrix:
2240
python-version: ["3.10", "3.11"]
23-
runs-on:
24-
labels: Linux_runner_8_core
41+
os: ${{ fromJson(needs.prepare-matrix.outputs.os) }}
42+
runs-on: ${{ matrix.os }}
2543
steps:
2644
- uses: actions/checkout@v3
2745
with:

requirements.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
-f https://download.pytorch.org/whl/torch/
2-
torch==2.5.1+cpu
3-
-f https://download.pytorch.org/whl/torchvision/
4-
torchvision==0.20.1+cpu
5-
-f https://download.pytorch.org/whl/torchaudio/
6-
torchaudio==2.5.1+cpu
1+
torch==2.5.1
2+
torchvision==0.20.1
3+
torchaudio==2.5.1
74
--pre
85
tf-nightly>=2.19.0.dev20241201
96
ai-edge-litert-nightly

0 commit comments

Comments
 (0)