Pull the CI setup into a composite action
The upcoming parallel jobs share it.
This commit is contained in:
parent
cc45b78e5d
commit
49276bb9cf
2 changed files with 31 additions and 18 deletions
30
.forgejo/actions/setup/action.yaml
Normal file
30
.forgejo/actions/setup/action.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: Set up `velofy`
|
||||||
|
description: Install R, `uv`, and `velofy` with its dependencies
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
# Same `uv` version as pinned in pyproject.toml
|
||||||
|
- name: Install `uv` and `python3.14`
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -LsSf https://astral.sh/uv/0.13.10/install.sh | sh
|
||||||
|
echo "$HOME/.local/bin" >> "$FORGEJO_PATH"
|
||||||
|
"$HOME/.local/bin/uv" python install 3.14
|
||||||
|
|
||||||
|
- name: Install `velofy` and its dependencies
|
||||||
|
shell: bash
|
||||||
|
run: '"$HOME/.local/bin/uv" sync --locked'
|
||||||
|
|
@ -53,24 +53,7 @@ jobs:
|
||||||
if: forgejo.ref_name != 'develop' && forgejo.ref_name != 'main'
|
if: forgejo.ref_name != 'develop' && forgejo.ref_name != 'main'
|
||||||
run: "! git rev-list --merges origin/develop..HEAD | grep ."
|
run: "! git rev-list --merges origin/develop..HEAD | grep ."
|
||||||
|
|
||||||
- name: Install R via system packages
|
- uses: ./.forgejo/actions/setup
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install --no-install-recommends \
|
|
||||||
r-base-dev \
|
|
||||||
r-cran-forecast \
|
|
||||||
r-cran-zoo \
|
|
||||||
-y
|
|
||||||
|
|
||||||
# Same `uv` version as pinned in pyproject.toml
|
|
||||||
- name: Install `uv` and `python3.14`
|
|
||||||
run: |
|
|
||||||
curl -LsSf https://astral.sh/uv/0.13.10/install.sh | sh
|
|
||||||
echo "$HOME/.local/bin" >> "$FORGEJO_PATH"
|
|
||||||
"$HOME/.local/bin/uv" python install 3.14
|
|
||||||
|
|
||||||
- name: Install `velofy` and its dependencies
|
|
||||||
run: uv sync --locked
|
|
||||||
|
|
||||||
- name: Ensure `nox -s format` changes nothing
|
- name: Ensure `nox -s format` changes nothing
|
||||||
run: uv run nox -s format && git diff --exit-code
|
run: uv run nox -s format && git diff --exit-code
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue