Skip to content

Commit 835f3c5

Browse files
ofirgoOfir Gordon
andauthored
Add GitHub actions for extended tests (#37)
- Dedicated Pytorch and TF tests for nightly run. - Python 3.10 tests. - Changed Python tests to work with the latest supported TF and Torch versions - 2.12 and 1.13, respectively. Co-authored-by: Ofir Gordon <Ofir.Gordon@altair-semi.com>
1 parent f205a9b commit 835f3c5

9 files changed

+132
-4
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run Keras Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tf-version:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
run-tensorflow-tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install Python 3
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.10
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
pip install tensorflow==${{ inputs.tf-version }}
24+
- name: Run unittests
25+
run: |
26+
python -m unittest discover tests/keras_tests -v
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run PyTorch Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
torch-version:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
run-pytorch-tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install Python 3
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.10
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
pip install torch==${{ inputs.torch-version }} torchvision
24+
- name: Run unittests
25+
run: python -m unittest discover tests/pytorch_tests -v
26+
27+
28+
29+

.github/workflows/run_tests_suite_pip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
run: |
2727
git checkout tags/${{ inputs.mct_quantizers_version }}
2828
pip install -r requirements.txt
29-
pip install tensorflow==2.11
30-
pip install torch==1.13 torchvision
29+
pip install tensorflow==2.12.*
30+
pip install torch==1.13.* torchvision
3131
- name: Build WHL file
3232
run: |
3333
version=$(python -c 'import mct_quantizers; print(mct_quantizers.__version__)')
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Python 3.10
2+
on:
3+
workflow_dispatch: # Allow manual triggers
4+
schedule:
5+
- cron: 0 0 * * *
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
env:
15+
COVERAGE_THRESHOlD: 80
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Install Python 3
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: '3.10'
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r requirements.txt
26+
pip install tensorflow==2.12.*
27+
pip install torch==1.13.*
28+
- name: Run unittests
29+
run: python -m unittest discover -s tests -v

.github/workflows/run_tests_suite.yml renamed to .github/workflows/run_tests_suite_python39.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
python -m pip install --upgrade pip
2525
pip install -r requirements.txt
26-
pip install tensorflow==2.11.*
27-
pip install torch
26+
pip install tensorflow==2.12.*
27+
pip install torch==1.13.*
2828
- name: Run unittests
2929
run: python -m unittest discover -s tests -v
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Tests - Tensorflow 2.11
2+
on:
3+
workflow_dispatch: # Allow manual triggers
4+
schedule:
5+
- cron: 0 0 * * *
6+
7+
jobs:
8+
run-tensorflow-2_11:
9+
uses: ./.github/workflows/run_keras_tests.yml
10+
with:
11+
tf-version: "2.11.*"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Tests - Tensorflow 2.12
2+
on:
3+
workflow_dispatch: # Allow manual triggers
4+
schedule:
5+
- cron: 0 0 * * *
6+
7+
jobs:
8+
run-tensorflow-2_12:
9+
uses: ./.github/workflows/run_keras_tests.yml
10+
with:
11+
tf-version: "2.12.*"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Tests - PyTorch 1.12
2+
on:
3+
workflow_dispatch: # Allow manual triggers
4+
schedule:
5+
- cron: 0 0 * * *
6+
7+
jobs:
8+
run-pytorch-1_13:
9+
uses: ./.github/workflows/run_pytorch_tests.yml
10+
with:
11+
torch-version: "1.12.*"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Tests - PyTorch 1.13
2+
on:
3+
workflow_dispatch: # Allow manual triggers
4+
schedule:
5+
- cron: 0 0 * * *
6+
7+
jobs:
8+
run-pytorch-1_13:
9+
uses: ./.github/workflows/run_pytorch_tests.yml
10+
with:
11+
torch-version: "1.13.*"

0 commit comments

Comments
 (0)