stammtisch-bot/.forgejo/workflows/testing.yaml
Max R. Carrara fee37c2372
All checks were successful
/ test (push) Successful in 7s
workflows: add workflow for running tests
This uses the python:3.13 docker image and also installs uv
beforehand. Checkout is performed "manually" because the standard
actions/checkout@v4 action requires node:20 as container, which is
annoying. I don't want to pull in node just to clone a git repo.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-06 02:37:26 +01:00

28 lines
834 B
YAML

on: [push]
env:
GIT_CLONE_PATH: "project"
jobs:
test:
runs-on: docker
# Note: will require node:20 for running actions/checkout@v4 and actions/cache@v4
# So... should maybe build a custom image or something? Image registry?
container:
image: python:3.13
steps:
- name: Download & install uv
run: |
set -ex
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Clone repository
run: |
set -ex
FORGE_URL="$(echo ${{ github.server_url }}/${{ github.repository }}.git | sed 's#https://##')"
git clone --depth 1 "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@${FORGE_URL}" "${GIT_CLONE_PATH}"
- name: Run tests
run: |
set -ex
. $HOME/.local/bin/env
cd project && uv run pytest