forked from keras-team/keras-tuner
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (96 loc) · 2.96 KB
/
actions.yml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Tests
on:
push:
branches: [main]
pull_request:
release:
types: [created]
permissions:
contents: read
jobs:
lint-and-format:
name: Lint, format, test example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
id: setup-uv
with:
enable-cache: true
version: "0.4.14"
github-token: ${{ secrets.GITHUB_TOKEN }}
# Note that astral-sh/setup-uv will automatically use a separate cache key for each host architecture and platform.
- name: Install Python 3.10
uses: uv python install 3.10
- name: Install the project
run: uv sync --all-extras --no-progress
- name: Lint
run: uv run -- ruff check --extend-select I --fix
- name: Format
run: uv run -- ruff format
- name: run example
run: uv example.py
tensorflow:
name: single backend test across python versions.
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
id: setup-uv
with:
enable-cache: true
version: "0.4.14"
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{matrix.python-version}}
- name: Install the project
run: uv sync --all-extras --no-progress
- name: Do something if the cache was restored
if: steps.setup-uv.outputs.cache-hit == 'true'
run: echo "Cache was restored"
- name: Test with PyTest
env:
KERAS_BACKEND: "tensorflow" # not needed, but for the future.
run: |
uv run -- pytest --cov=keras_tuner --cov-report xml:coverage.xml
- name: Codecov
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage.xml # optional
name: keras_tuner # optional
token: ${{ secrets.GITHUB_TOKEN }} # required
verbose: true # optional (default = false)
# test-multibackend:
# name: Multibackend, multi-python test.
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version:
# - "3.10"
# - "3.11"
# - "3.12"
# backend: [tensorflow, jax, torch]
# fail-fast: false
# steps:
# - uses: actions/checkout@v4
# - name: Install uv
# uses: astral-sh/setup-uv@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{matrix.python-version}}
# - name: Install the project
# run: uv sync --all-extras --dev
# - name: Test with PyTest
# env:
# KERAS_BACKEND: ${{ matrix.backend }}
# run: uv run -- pytest