Skip to content

Commit

Permalink
update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
flaport committed Feb 13, 2025
1 parent 4b924b3 commit 04dac0b
Show file tree
Hide file tree
Showing 8 changed files with 5,124 additions and 206 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Docs
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:

run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Create Venv
run: uv sync --all-extras
- name: Run notebooks
run: find . -name "*.ipynb" -not -path "*/tests/*" -not -path "*/.ipynb_checkpoints/*" | xargs parallel uv run papermill {} {} -k python3 ':::'
- name: Upload artifacts [internals]
uses: actions/upload-artifact@v4
with:
name: internals
path: ./internals
- name: Upload artifacts [examples]
uses: actions/upload-artifact@v4
with:
name: examples
path: ./examples

docs:
runs-on: ubuntu-latest
needs:
- run
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifacts [internals]
uses: actions/download-artifact@v4
with:
name: internals
path: ./internals
- name: Download artifacts [examples]
uses: actions/download-artifact@v4
with:
name: examples
path: ./examples
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Create Venv
run: uv sync --all-extras
- name: Build docs
run: make docs && touch docs/build/html/.nojekyll
- name: Upload artifacts [docs]
uses: actions/upload-artifact@v4
with:
name: docs
path: ./docs/build/html

pages:
runs-on: ubuntu-latest
needs:
- docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download 'docs' artifact
uses: actions/download-artifact@master
with:
name: docs
path: docs/build/html
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: pages
folder: docs/build/html
134 changes: 0 additions & 134 deletions .github/workflows/main.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/publish.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release
on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Create Venv
run: uv sync --all-extras
- name: Build Wheels
run: make build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist

release:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Wheels
uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: PyPI Release
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]

test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Create Venv
run: uv sync --all-extras
- name: Run tests
run: pytest
- name: Upload artifacts [tests]
uses: actions/upload-artifact@master
with:
name: tests
path: ./tests

5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
build:
python -m build --sdist --wheel
uv run python -m build --sdist --wheel

docker:
docker build . -t flaport/sax:latest -f Dockerfile.dev
docker build . -t flaport/sax:0.14.1 -f Dockerfile.dev

pre-commit:
pre-commit install
git config filter.nbstripout.extrakeys 'metadata.papermill'

nbrun:
find . -name "*.ipynb" -not -path "*/.ipynb_checkpoints/*" | xargs parallel -j `nproc --all` papermill {} {} -k python3 :::
find . -name "*.ipynb" -not -path "*/.ipynb_checkpoints/*" | xargs parallel -j `nproc --all` uv run papermill {} {} -k python3 :::
rm -rf modes

dockerpush:
Expand Down
Loading

0 comments on commit 04dac0b

Please sign in to comment.