From 7ec049075d13a694689fde0fed23b53c3eed2acb Mon Sep 17 00:00:00 2001 From: stephantul Date: Sat, 30 May 2026 13:02:55 +0200 Subject: [PATCH 1/2] feat: add default workflows --- .github/workflows/ci.yaml | 59 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 40 +++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..641d28d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,59 @@ +name: Run tests and upload coverage + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + name: Run tests with pytest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "windows-latest"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + + - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Install uv + uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff + + - name: Create virtual environment + run: uv venv .venv + + - name: Add venv to PATH (Linux/macOS) + if: runner.os != 'Windows' + run: | + echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV + echo "$PWD/.venv/bin" >> $GITHUB_PATH + + - name: Add venv to PATH (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + "VIRTUAL_ENV=.venv" >> $env:GITHUB_ENV + "$pwd\.venv\Scripts" >> $env:GITHUB_PATH + + - name: Install dependencies + run: make install + + - name: Run tests under coverage + shell: bash + run: | + coverage run --source=model2vec -m pytest + coverage report + + - name: Upload results to Codecov + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..0fd128c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,40 @@ +name: Release to PyPI + +on: + workflow_dispatch: + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + + - name: Install uv + uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff + + - name: Build package + run: uv build + + - name: Upload dist + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: dist + path: dist/ + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - name: Download dist + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 + with: + name: dist + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b From d968cce11551be21f3aa094b9e1498701512e237 Mon Sep 17 00:00:00 2001 From: stephantul Date: Sat, 30 May 2026 13:05:04 +0200 Subject: [PATCH 2/2] ok maybeeee --- {.github => DOT_github}/workflows/ci.yaml | 2 +- {.github => DOT_github}/workflows/release.yaml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {.github => DOT_github}/workflows/ci.yaml (96%) rename {.github => DOT_github}/workflows/release.yaml (100%) diff --git a/.github/workflows/ci.yaml b/DOT_github/workflows/ci.yaml similarity index 96% rename from .github/workflows/ci.yaml rename to DOT_github/workflows/ci.yaml index 641d28d..da39249 100644 --- a/.github/workflows/ci.yaml +++ b/DOT_github/workflows/ci.yaml @@ -50,7 +50,7 @@ jobs: - name: Run tests under coverage shell: bash run: | - coverage run --source=model2vec -m pytest + coverage run --source=PACKAGE -m pytest coverage report - name: Upload results to Codecov diff --git a/.github/workflows/release.yaml b/DOT_github/workflows/release.yaml similarity index 100% rename from .github/workflows/release.yaml rename to DOT_github/workflows/release.yaml