1
1
name : Tests
2
2
3
+ # TODO: Consider enabling all tests (pytest, applications, etc.) with NNX in the future
4
+ # Currently only basic flow tests run with NNX enabled
5
+
3
6
on :
4
7
push :
5
8
branches : [ master ]
@@ -17,11 +20,18 @@ jobs:
17
20
matrix :
18
21
python-version : ['3.10']
19
22
backend : [tensorflow, jax, torch, numpy, openvino]
23
+ nnx_enabled : [false]
24
+ include :
25
+ - python-version : ' 3.10'
26
+ backend : jax
27
+ nnx_enabled : true
20
28
name : Run tests
21
29
runs-on : ubuntu-latest
22
30
env :
23
31
PYTHON : ${{ matrix.python-version }}
24
32
KERAS_HOME : .github/workflows/config/${{ matrix.backend }}
33
+ KERAS_BACKEND : ${{ matrix.backend }}
34
+ KERAS_NNX_ENABLED : ${{ matrix.nnx_enabled }}
25
35
steps :
26
36
- uses : actions/checkout@v4
27
37
- name : Check for changes in keras/src/applications
48
58
- name : Install dependencies
49
59
run : |
50
60
pip install -r requirements.txt --progress-bar off --upgrade
61
+ if [ "${{ matrix.nnx_enabled }}" == "true" ]; then
62
+ pip install --upgrade git+https://github.com/divyashreepathihalli/flax.git@use-id
63
+ fi
51
64
pip uninstall -y keras keras-nightly
52
65
pip install -e "." --progress-bar off --upgrade
53
66
- name : Test applications with pytest
73
86
if : ${{ matrix.backend == 'jax'}}
74
87
run : |
75
88
python integration_tests/jax_custom_fit_test.py
89
+ - name : Test basic flow with NNX
90
+ if : ${{ matrix.nnx_enabled == 'true'}}
91
+ run : |
92
+ python integration_tests/import_test.py
93
+ python integration_tests/basic_full_flow.py
76
94
- name : Test TF-specific integrations
77
95
if : ${{ matrix.backend == 'tensorflow'}}
78
96
run : |
96
114
- name : Codecov keras
97
115
uses : codecov/codecov-action@v5
98
116
with :
99
- env_vars : PYTHON,KERAS_HOME
100
- flags : keras,keras-${{ matrix.backend }}
117
+ env_vars : PYTHON,KERAS_HOME,KERAS_BACKEND,KERAS_NNX_ENABLED
118
+ flags : keras,keras-${{ matrix.backend }}${{ matrix.nnx_enabled == 'true' && '-nnx' || '' }}
101
119
files : core-coverage.xml
102
120
token : ${{ secrets.CODECOV_TOKEN }}
103
121
fail_ci_if_error : false
0 commit comments