Skip to content
Open
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
102 changes: 102 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: docs
permissions:
contents: write
pull-requests: write

on:
push:
branches:
- main
paths:
- .pre-commit-config.yaml
- .github/workflows/docs.yml
- '**.py'
- '**.ipynb'
- '**.html'
- '**.js'
- '**.md'
- '**.rst'
- uv.lock
- pyproject.toml
- mkdocs.yml
- '**.png'
- '**.svg'
pull_request:
branches:
- main
paths:
- .pre-commit-config.yaml
- .github/workflows/docs.yml
- '**.py'
- '**.ipynb'
- '**.js'
- '**.html'
- uv.lock
- pyproject.toml
- '**.md'
- '**.rst'
- mkdocs.yml
- '**.png'
- '**.svg'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7.1.5
with:
version: "0.9.11"
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v6.1.0
with:
python-version-file: ".python-version"

- name: Install the project
run: uv sync --group docs --group test

- name: Build docs
run: uv run mkdocs build

- name: Create .nojekyll file
run: touch site/.nojekyll

- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: docs-site
path: site/
retention-days: 1

deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

- name: Download artifact
uses: actions/download-artifact@v6
with:
name: docs-site
path: site

- name: Ensure .nojekyll exists
run: touch site/.nojekyll

- name: Deploy to Github pages
uses: JamesIves/github-pages-deploy-action@v4.7.6
with:
branch: github_pages
folder: site
26 changes: 0 additions & 26 deletions .github/workflows/docs_build.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/docs_publish.yml

This file was deleted.

21 changes: 15 additions & 6 deletions .github/workflows/publish_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,23 @@ jobs:
- name: Install apt dependencies
run: |
sudo apt-get update
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v6

- name: Checkout code
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7.1.5
with:
version: "0.9.11"

- name: Set up Python
uses: actions/setup-python@v6.1.0
with:
python-version: "3.10"
python-version-file: ".python-version"

- name: Build package
run: poetry build
run: uv build

- name: Publish package
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
Expand Down
38 changes: 12 additions & 26 deletions .github/workflows/smoke_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,28 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python 3.10
uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@v7.1.5
with:
python-version: "3.10"
version: "0.9.11"
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v6.1.0
with:
python-version-file: ".python-version"

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Set up file descriptor limit
run: ulimit -n 4096

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Set up cache
uses: actions/cache@v5
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with "dev, test"
run: uv sync --group dev --group test

- name: Run Script
run: |
source .venv/bin/activate
pytest --test-group-count=4 --test-group=${{ matrix.group }} -v --cov fl4health --cov-report=xml tests/smoke_tests/test_smoke_tests.py
run: uv run pytest --test-group-count=4 --test-group=${{ matrix.group }} -v --cov fl4health --cov-report=xml tests/smoke_tests/test_smoke_tests.py

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -64,14 +53,11 @@ jobs:
fail_ci_if_error: true
verbose: true

# Deleting some temporary files and useless folders to free up space in order to have space for
# the cache file, and printing the disk space info at the beggining and end.
# Deleting poetry cache should clear ~4GB of space.
# Deleting some temporary files and useless folders to free up space
# Deleting /usr/share/dotnet should clear ~4GB of space.
# Deleting /usr/local/lib/android should clear ~12GB of space.
- name: Cleanup space (before cache save)
run: |
df -h /dev/root
poetry cache clear --all . --no-interaction
sudo rm -rf /usr/share/dotnet /usr/local/lib/android
df -h /dev/root
43 changes: 21 additions & 22 deletions .github/workflows/static_code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,47 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install and configure Poetry
uses: snok/install-poetry@v1

- name: Install uv
uses: astral-sh/setup-uv@v7.1.5
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v5
id: cached-poetry-dependencies
version: "0.9.11"
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v6.1.0
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
python-version-file: ".python-version"

- name: Install dependencies
run: poetry install --with "dev, test, codestyle"
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: uv sync --group dev --group test --group codestyle

- name: Pre-commit Checks
run: |
source .venv/bin/activate
pre-commit run --all-files
run: uv run pre-commit run --all-files

- name: pip-audit (gh-action-pip-audit)
uses: pypa/gh-action-pip-audit@v1.1.0
with:
virtual-environment: .venv/
# GHSA-3749-ghw9-m3mg and GHSA-887c-mr87-cxwp are pytorch vulnerabilities that require 2.7 and 2.8 but we're
# pinning to 2.6.0 for now.
# GHSA-wf7f-8fxf-xfxc ML Flow vulnerability in deserialization that hasn't been patched yet.
# CVE-2024-55459, CVE-2025-9906, CVE-2025-12058, CVE-2025-12060 are keras vulnerabilities that require 3.11.0+
# but we're pinning to keras 2.15 for tensorflow 2.15 compatibility.
ignore-vulns: |
GHSA-3749-ghw9-m3mg
GHSA-887c-mr87-cxwp
GHSA-wf7f-8fxf-xfxc
CVE-2024-55459
CVE-2025-9906
CVE-2025-12058
CVE-2025-12060

# Deleting some temporary files and useless folders to free up space in order to have space for
# the cache file, and printing the disk space info at the beggining and end.
# Deleting poetry cache should clear ~4GB of space.
# Deleting some temporary files and useless folders to free up space
# Deleting /usr/share/dotnet should clear ~4GB of space.
# Deleting /usr/local/lib/android should clear ~12GB of space.
- name: Cleanup space (before cache save)
run: |
df -h /dev/root
poetry cache clear --all . --no-interaction
sudo rm -rf /usr/share/dotnet /usr/local/lib/android
df -h /dev/root
Loading