Skip to content

Commit 25a08f2

Browse files
committed
Switch CI to self-hosted runners
1 parent 03bf390 commit 25a08f2

2 files changed

Lines changed: 15 additions & 17 deletions

File tree

.github/workflows/actions.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,25 @@ jobs:
2929
version: keras-nightly
3030
- backend: openvino
3131
version: keras-nightly
32-
runs-on: ubuntu-latest
32+
33+
container:
34+
image: python:3.11-slim
35+
36+
runs-on: linux-x86-n2-16
37+
timeout-minutes: 120
3338
env:
3439
KERAS_BACKEND: ${{ matrix.backend }}
3540
steps:
41+
- name: Install binary dependencies
42+
# build-essential for C extensions (tokenizers, torch)
43+
# curl, git, gnupg for checkout and other actions
44+
run: |
45+
apt-get update
46+
apt-get -y install build-essential curl git gnupg
47+
git config --global --add safe.directory '*'
3648
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
3749
with:
3850
persist-credentials: false
39-
- name: Set up Python 3.11
40-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
41-
with:
42-
python-version: '3.11'
43-
- name: Get pip cache dir
44-
id: pip-cache
45-
run: |
46-
python -m pip install --upgrade pip setuptools
47-
echo "::set-output name=dir::$(pip cache dir)"
48-
- name: pip cache
49-
# zizmor: ignore[cache-poisoning]
50-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
51-
with:
52-
path: ${{ steps.pip-cache.outputs.dir }}
53-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-common.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
5451
- name: Install dependencies
5552
run: |
5653
pip install -r requirements.txt --progress-bar off
@@ -68,7 +65,7 @@ jobs:
6865
pip install keras-nightly --no-cache-dir --progress-bar off
6966
- name: Test with pytest
7067
run: |
71-
pytest keras_hub/
68+
pytest keras_hub/ -n auto --dist loadfile --durations=50
7269
- name: Run integration tests
7370
run: |
7471
python pip_build.py --install

requirements-common.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ packaging
1313
ruff
1414
pytest
1515
pytest-cov
16+
pytest-xdist
1617
build
1718
namex
1819
# Optional deps.

0 commit comments

Comments
 (0)