Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 0 additions & 147 deletions .github/workflows/python-ci.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and test

on:
push:
branches: [main]
pull_request:
branches: [main, cmd_line]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
# CPU-only torch wheel: avoids the multi-GB CUDA download on the runner
pip install -r requirements.txt -r requirements-dev.txt \
--extra-index-url https://download.pytorch.org/whl/cpu

- name: Check that the framework imports
run: |
python -c "import flcore.utils"
python server_cmd.py --help > /dev/null
python client_cmd.py --help > /dev/null

- name: Run tests
run: pytest tests -n 4 --verbose --durations=10

- name: Upload federation logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: pytest-tmp
path: /tmp/pytest-of-runner/
if-no-files-found: ignore
retention-days: 7
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
testpaths = tests
addopts = -ra
filterwarnings =
ignore::DeprecationWarning
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest>=8
pytest-xdist>=3
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ pdfkit==1.0.0
scikit-survival==0.22.2
fpboost==0.1.0
setuptools==80.9.0
pyarrow==25.0.1
16 changes: 16 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import sys
from pathlib import Path

import pytest

sys.path.insert(0, str(Path(__file__).resolve().parent))

from synthetic_data import DEFAULT_N_SAMPLES, write_dataset # noqa: E402


@pytest.fixture(scope="session")
def synthetic_data_dir(tmp_path_factory):
"""Directory with ``data.parquet`` + ``metadata.json`` of 100 synthetic rows."""
path = tmp_path_factory.mktemp("synthetic_dt4h")
write_dataset(path, n_samples=DEFAULT_N_SAMPLES, seed=0)
return path
Loading
Loading