2026-12-02 22:41:16 +01:00
|
|
|
name: Set up `velofy`
|
2026-12-03 00:40:02 +01:00
|
|
|
description: Install R, `uv`, `nox`, and `pre-commit`
|
2026-12-02 22:41:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
runs:
|
|
|
|
|
using: composite
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
|
- name: Install R via system packages
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
apt-get update
|
|
|
|
|
apt-get install --no-install-recommends \
|
|
|
|
|
r-base-dev \
|
|
|
|
|
r-cran-forecast \
|
|
|
|
|
r-cran-zoo \
|
|
|
|
|
-y
|
|
|
|
|
|
2026-12-03 00:19:16 +01:00
|
|
|
# Built wheels (e.g., `rpy2`) and Python versions, keyed by their pins
|
|
|
|
|
# => Only the "lint" job in ci.yaml saves the cache
|
|
|
|
|
- name: Restore the `uv` cache
|
|
|
|
|
id: uv-cache
|
|
|
|
|
uses: actions/cache/restore@v4
|
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.cache/uv
|
|
|
|
|
~/.local/share/uv/python
|
|
|
|
|
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock', 'pyproject.toml') }}
|
|
|
|
|
restore-keys: uv-${{ runner.os }}-
|
|
|
|
|
|
|
|
|
|
# Tell the "lint" job in ci.yaml the key and if it must save the cache
|
|
|
|
|
- name: Remember the `uv` cache key and if it was restored exactly
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
echo "UV_CACHE_KEY=${{ steps.uv-cache.outputs.cache-primary-key }}" >> "$FORGEJO_ENV"
|
|
|
|
|
echo "UV_CACHE_HIT=${{ steps.uv-cache.outputs.cache-hit }}" >> "$FORGEJO_ENV"
|
|
|
|
|
|
2026-12-02 23:45:45 +01:00
|
|
|
# All `SUPPORTED_PYTHONS` from the "classifiers" in pyproject.toml
|
|
|
|
|
# => `nox` would otherwise pick the system's Python without headers
|
|
|
|
|
- name: Install `uv` and all supported Python versions
|
2026-12-02 22:41:16 +01:00
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
curl -LsSf https://astral.sh/uv/0.13.10/install.sh | sh
|
|
|
|
|
echo "$HOME/.local/bin" >> "$FORGEJO_PATH"
|
2026-12-02 23:45:45 +01:00
|
|
|
"$HOME/.local/bin/uv" python install $(grep -oP 'Programming Language :: Python :: \K3\.\d+' pyproject.toml)
|
2026-12-02 22:41:16 +01:00
|
|
|
|
2026-12-03 00:40:02 +01:00
|
|
|
# The jobs only use `nox` and `pre-commit` from the develop environment
|
|
|
|
|
# => The `nox` sessions install `velofy` and its dependencies themselves
|
|
|
|
|
- name: Install `nox` and `pre-commit`
|
2026-12-02 22:41:16 +01:00
|
|
|
shell: bash
|
2026-12-03 00:40:02 +01:00
|
|
|
run: '"$HOME/.local/bin/uv" sync --locked --only-group dev'
|