From fee37c2372275504ad6cfabc1e0f3f513fec4c2e Mon Sep 17 00:00:00 2001 From: "Max R. Carrara" Date: Thu, 6 Mar 2025 01:33:21 +0100 Subject: [PATCH] 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 --- .forgejo/workflows/testing.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .forgejo/workflows/testing.yaml diff --git a/.forgejo/workflows/testing.yaml b/.forgejo/workflows/testing.yaml new file mode 100644 index 0000000..80a1e38 --- /dev/null +++ b/.forgejo/workflows/testing.yaml @@ -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 +