forked from keras-team/keras-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (97 loc) · 3.15 KB
/
actions.yml
File metadata and controls
100 lines (97 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Tests
on:
push:
pull_request:
workflow_call:
release:
types: [created]
permissions:
contents: read
jobs:
run_tests:
name: Test the code
strategy:
fail-fast: false
matrix:
backend: [tensorflow, jax, torch]
version: [keras-stable]
include:
- backend: jax
version: keras-3.13
- backend: jax
version: keras-nightly
- backend: openvino
version: keras-nightly
runs-on: ubuntu-latest
env:
KERAS_BACKEND: ${{ matrix.backend }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip setuptools
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-common.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
pip install -r requirements.txt --progress-bar off
pip install --no-deps -e "." --progress-bar off
- name: Pin Keras 3.13
if: ${{ matrix.version == 'keras-3.13'}}
run: |
pip uninstall -y keras jaxlib jax
pip install keras==3.13.0 --progress-bar off
pip install jax==0.6.0 --progress-bar off
- name: Pin Keras Nightly
if: ${{ matrix.version == 'keras-nightly'}}
run: |
pip uninstall -y keras
pip install keras-nightly --no-cache-dir --progress-bar off
- name: Test with pytest
run: |
pytest keras_hub/
- name: Run integration tests
run: |
python pip_build.py --install
cd integration_tests && pytest . -k "not NoTensorflow"
- name: Run no tensorflow integration test
if: ${{ matrix.backend != 'tensorflow'}}
run: |
pip uninstall -y tensorflow-text tensorflow
cd integration_tests && pytest . -k "NoTensorflow"
check_format:
name: Check the code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip setuptools
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-common.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
pip install -r requirements.txt --progress-bar off
pip install --no-deps -e "." --progress-bar off
- name: Install pre-commit
run: pip install pre-commit && pre-commit install
- name: Run pre-commit
run: pre-commit run --all-files --hook-stage manual