workflows: add workflow for running tests
All checks were successful
/ test (push) Successful in 7s

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>
This commit is contained in:
Max R. Carrara 2025-03-06 01:33:21 +01:00
parent 15e01aae8c
commit fee37c2372

View file

@ -0,0 +1,28 @@
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