Skip to content

Commit bb973d2

Browse files
committed
Merge branch 'main' into dev
# Conflicts: # .github/workflows/tests.yaml
2 parents 4d731f9 + 80a2763 commit bb973d2

File tree

2 files changed

+71
-60
lines changed

2 files changed

+71
-60
lines changed

.github/workflows/style.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check Code Style
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
- dev
9+
- update-workflows
10+
push:
11+
branches:
12+
- main
13+
- dev
14+
- update-workflows
15+
16+
jobs:
17+
check-code-style:
18+
name: Check Code Style
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.10"
30+
31+
- name: Install Ruff
32+
run: |
33+
pip install -U pip setuptools wheel
34+
pip install ruff
35+
36+
- name: Run Linter
37+
run: ruff check --config pyproject.toml --verbose
38+
39+
- name: Run Formatter
40+
run: ruff format --config pyproject.toml --check --verbose

.github/workflows/tests.yaml

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: Tests
2+
name: Multi-Backend Tests
33

44
on:
55
workflow_dispatch:
@@ -12,111 +12,82 @@ on:
1212
- main
1313
- dev
1414

15+
defaults:
16+
run:
17+
shell: bash
1518

16-
jobs:
17-
lint:
18-
runs-on: ubuntu-latest
19-
defaults:
20-
run:
21-
shell: bash -el {0}
22-
23-
steps:
24-
- name: Checkout code
25-
uses: actions/checkout@v4
26-
27-
- name: Set up Conda
28-
uses: conda-incubator/setup-miniconda@v3
29-
with:
30-
environment-file: environment.yaml
31-
python-version: "3.10"
32-
33-
- name: Show Environment Info
34-
run: |
35-
conda info
36-
conda list
37-
conda config --show-sources
38-
conda config --show
39-
printenv | sort
40-
41-
- name: Run Linter
42-
run: |
43-
ruff check --config pyproject.toml --verbose
44-
45-
- name: Run Formatter
46-
run: |
47-
ruff format --check --config pyproject.toml --verbose
4819

20+
jobs:
4921
test:
50-
runs-on: ${{ matrix.os }}
22+
name: Run Multi-Backend Tests
23+
5124
strategy:
52-
fail-fast: false
5325
matrix:
5426
os: [ubuntu-latest, windows-latest]
5527
python-version: ["3.10", "3.11"]
5628
backend: ["jax", "tensorflow", "torch"]
57-
defaults:
58-
run:
59-
shell: bash -el {0}
29+
30+
runs-on: ${{ matrix.os }}
31+
6032
env:
6133
KERAS_BACKEND: ${{ matrix.backend }}
6234

6335
steps:
64-
- name: Checkout code
36+
- name: Checkout Repository
6537
uses: actions/checkout@v4
6638

67-
- name: Set up Conda
68-
uses: conda-incubator/setup-miniconda@v3
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
6941
with:
70-
environment-file: environment.yaml
7142
python-version: ${{ matrix.python-version }}
7243

44+
- name: Install Dependencies
45+
run: |
46+
pip install -U pip setuptools wheel
47+
pip install .[test]
48+
7349
- name: Install JAX
7450
if: ${{ matrix.backend == 'jax' }}
7551
run: |
7652
pip install -U jax
77-
- name: Install NumPy
78-
if: ${{ matrix.backend == 'numpy' }}
79-
run: |
80-
conda install numpy
81-
- name: Install Tensorflow
53+
54+
- name: Install TensorFlow
8255
if: ${{ matrix.backend == 'tensorflow' }}
8356
run: |
8457
pip install -U tensorflow
58+
8559
- name: Install PyTorch
8660
if: ${{ matrix.backend == 'torch' }}
8761
run: |
88-
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
62+
pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
8963
9064
- name: Show Environment Info
9165
run: |
92-
conda info
93-
conda list
94-
conda config --show-sources
95-
conda config --show
66+
python --version
67+
pip --version
9668
printenv | sort
97-
conda env export
9869
pip list
9970
10071
- name: Run Tests
10172
run: |
10273
pytest -x -m "not slow"
10374
10475
- name: Run Slow Tests
105-
# run only on manual trigger
76+
# run all slow tests only on manual trigger
10677
if: github.event_name == 'workflow_dispatch'
10778
run: |
108-
pytest -x -m "slow"
109-
110-
- name: Create Coverage Report
111-
run: |
112-
coverage xml
79+
pytest -m "slow"
11380
11481
- name: Upload test results to Codecov
11582
if: ${{ !cancelled() }}
116-
uses: codecov/test-results-action@v1
83+
uses: codecov/codecov-action@v4
11784
with:
11885
token: ${{ secrets.CODECOV_TOKEN }}
11986

87+
- name: Create Coverage Report
88+
run: |
89+
coverage xml
90+
12091
- name: Upload Coverage Reports to CodeCov
12192
uses: codecov/codecov-action@v4
12293
with:

0 commit comments

Comments
 (0)