Migrate to forgejo
This commit is contained in:
parent
828f8a9231
commit
4c6441182b
11 changed files with 211 additions and 233 deletions
57
.forgejo/workflows/docker.yml
Normal file
57
.forgejo/workflows/docker.yml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
name: Publish on DockerHub
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['*']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# The `docker` runner image is node-based and may not ship the docker CLI
|
||||
# that the docker/* actions below drive; install it idempotently, as the
|
||||
# sibling repos do for their Docker jobs.
|
||||
- name: Ensure Docker CLI
|
||||
run: |
|
||||
set -eux
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
ARCH=$(uname -m)
|
||||
curl -fsSL --retry 3 --retry-connrefused \
|
||||
"https://download.docker.com/linux/static/stable/${ARCH}/docker-27.5.1.tgz" \
|
||||
| tar xz --strip-components=1 -C /usr/local/bin docker/docker
|
||||
fi
|
||||
docker --version
|
||||
|
||||
# Marketplace actions must be referenced by full URL: this instance's
|
||||
# DEFAULT_ACTIONS_URL points at code.forgejo.org, so only bare `actions/*`
|
||||
# names resolve to GitHub automatically.
|
||||
- name: Set up QEMU
|
||||
uses: https://github.com/docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata for the Docker image
|
||||
id: meta
|
||||
uses: https://github.com/docker/metadata-action@v5
|
||||
with:
|
||||
images: schmelczera/great-ai
|
||||
|
||||
- name: Build and push
|
||||
uses: https://github.com/docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
52
.forgejo/workflows/docs.yml
Normal file
52
.forgejo/workflows/docs.yml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
name: Publish documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'great_ai/**'
|
||||
- 'mkdocs.yaml'
|
||||
- '.forgejo/workflows/docs.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
# The mkdocs git-revision-date plugin reads each page's git history.
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install 3.10
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv venv --python 3.10
|
||||
uv pip install '.[dev]'
|
||||
|
||||
- name: Build documentation
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
mkdocs build
|
||||
|
||||
# The old workflow ran `mkdocs gh-deploy` (GitHub Pages); on this instance
|
||||
# built sites are rsynced into the host /pages mount that nginx serves,
|
||||
# via the shared ci-actions/deploy-pages action — same as photos/reconcile.
|
||||
- name: Deploy to pages mount
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: http://forgejo:3000/andras/ci-actions/deploy-pages@main
|
||||
with:
|
||||
source: site
|
||||
target: great-ai
|
||||
28
.forgejo/workflows/publish.yml
Normal file
28
.forgejo/workflows/publish.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
name: Publish on PyPI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['*']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install 3.10
|
||||
|
||||
# Forgejo cannot use PyPI trusted publishing (OIDC), so authenticate with
|
||||
# an API token, the same way the sibling repos publish their packages.
|
||||
- name: Build and publish
|
||||
env:
|
||||
FLIT_USERNAME: __token__
|
||||
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||
run: uvx flit publish
|
||||
73
.forgejo/workflows/test.yml
Normal file
73
.forgejo/workflows/test.yml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
name: Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, dev]
|
||||
pull_request:
|
||||
branches: [main, dev]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint, format & type checks
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install 3.10
|
||||
|
||||
- name: Install dependencies
|
||||
# --seed gives the venv its own pip, which scripts/check-python.sh shells
|
||||
# out to for its linters; '.[dev]' provides the rest (mypy resolves the
|
||||
# package's own imports against the installed tree).
|
||||
run: |
|
||||
uv venv --seed --python 3.10
|
||||
uv pip install '.[dev]'
|
||||
|
||||
- name: Check code and formatting
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
scripts/check-python.sh great_ai tests
|
||||
|
||||
test:
|
||||
name: Test on Python ${{ matrix.python-version }}
|
||||
runs-on: docker
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# pyproject declares >= 3.7, but uv's standalone CPython and the current
|
||||
# dependency floors (scikit-learn/numpy now require >= 3.9) no longer
|
||||
# build on 3.7/3.8. Re-add those rows if the constraints are relaxed.
|
||||
# The windows leg of the old GitHub matrix is dropped: this Forgejo
|
||||
# instance only has a Linux `docker` runner.
|
||||
python-version: ['3.9', '3.10']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv venv --python ${{ matrix.python-version }}
|
||||
uv pip install '.[dev]'
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
pytest --doctest-modules --asyncio-mode=strict
|
||||
Loading…
Add table
Add a link
Reference in a new issue