Skip to content

Commit 4e1edcf

Browse files
authored
Add daily Python 3.13 CPU-only tests to nightly workflow (#21566)
* add daily Python 3.13 CPU-only tests to nightly workflow * dynamic job names in nightly workflow
1 parent 0ecb55d commit 4e1edcf

File tree

1 file changed

+54
-7
lines changed

1 file changed

+54
-7
lines changed

.github/workflows/nightly.yml

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Nightly
33
on:
44
workflow_dispatch: # To Generate wheels on demand outside of schedule.
55
schedule:
6-
- cron: '0 3 * * *' # run at 3 AM UTC / 8 PM PDT
6+
- cron: "0 3 * * *" # run at 3 AM UTC / 8 PM PDT
77

88
permissions:
99
contents: read
@@ -13,9 +13,9 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ['3.10']
16+
python-version: ["3.10"]
1717
backend: [tensorflow, jax, torch, numpy]
18-
name: Run tests
18+
name: Run tests (Python ${{ matrix.python-version }})
1919
runs-on: ubuntu-latest
2020
env:
2121
PYTHON: ${{ matrix.python-version }}
@@ -57,6 +57,54 @@ jobs:
5757
run: |
5858
pytest keras --ignore keras/src/applications --cov=keras --cov-config=pyproject.toml
5959
60+
build-python-latest:
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
python-version: ["3.13"]
65+
backend: [tensorflow, jax, torch, numpy]
66+
name: Run tests (Python ${{ matrix.python-version }})
67+
runs-on: ubuntu-latest
68+
env:
69+
PYTHON: ${{ matrix.python-version }}
70+
KERAS_BACKEND: ${{ matrix.backend }}
71+
steps:
72+
- uses: actions/checkout@v4
73+
- name: Set up Python
74+
uses: actions/setup-python@v5
75+
with:
76+
python-version: ${{ matrix.python-version }}
77+
- name: Get pip cache dir
78+
id: pip-cache
79+
run: |
80+
python -m pip install --upgrade pip setuptools
81+
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
82+
- name: pip cache
83+
uses: actions/cache@v4
84+
with:
85+
path: ${{ steps.pip-cache.outputs.dir }}
86+
key: ${{ runner.os }}-pip-latest-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}
87+
- name: Install dependencies
88+
run: |
89+
pip install -r requirements.txt --progress-bar off --upgrade
90+
pip uninstall -y keras keras-nightly
91+
pip install -e "." --progress-bar off --upgrade
92+
- name: Test integrations
93+
if: ${{ matrix.backend != 'numpy'}}
94+
run: |
95+
python integration_tests/import_test.py
96+
- name: Test TF-specific integrations
97+
if: ${{ matrix.backend == 'tensorflow'}}
98+
run: |
99+
python integration_tests/tf_distribute_training_test.py
100+
- name: Test Torch-specific integrations
101+
if: ${{ matrix.backend == 'torch'}}
102+
run: |
103+
pytest integration_tests/torch_workflow_test.py
104+
- name: Test with pytest
105+
run: |
106+
pytest keras --ignore keras/src/applications --cov=keras --cov-config=pyproject.toml
107+
60108
format:
61109
name: Check the code format
62110
runs-on: ubuntu-latest
@@ -65,7 +113,7 @@ jobs:
65113
- name: Set up Python 3.10
66114
uses: actions/setup-python@v6
67115
with:
68-
python-version: '3.10'
116+
python-version: "3.10"
69117
- name: Get pip cache dir
70118
id: pip-cache
71119
run: |
@@ -84,17 +132,16 @@ jobs:
84132
- name: Run pre-commit
85133
run: pre-commit run --all-files --hook-stage manual
86134

87-
88135
nightly:
89136
name: Build Wheel file and upload
90-
needs: [build, format]
137+
needs: [build, build-python-latest, format]
91138
runs-on: ubuntu-latest
92139
steps:
93140
- uses: actions/checkout@v5
94141
- name: Set up Python
95142
uses: actions/setup-python@v6
96143
with:
97-
python-version: '3.10'
144+
python-version: "3.10"
98145
- name: Install dependencies
99146
run: |
100147
python -m pip install --upgrade pip setuptools

0 commit comments

Comments
 (0)