From e12fe78138b5f8b960da72f06e98f8af0846a5a9 Mon Sep 17 00:00:00 2001 From: ScuroNeko Date: Thu, 23 Apr 2026 15:22:08 +0300 Subject: [PATCH] test --- .gitea/workflows/docker.yaml | 1 + .gitea/workflows/python.yaml | 38 ++++++++++++++++++++++++++++++++++++ Dockerfile => go.Dockerfile | 2 +- main.py | 7 +++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/python.yaml rename Dockerfile => go.Dockerfile (88%) create mode 100644 main.py diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml index 5043615..7000496 100644 --- a/.gitea/workflows/docker.yaml +++ b/.gitea/workflows/docker.yaml @@ -39,6 +39,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . + file: go.Dockerfile push: true tags: | git.scuroneko.dev/scuroneko/runner-test:${{ gitea.ref_name }} diff --git a/.gitea/workflows/python.yaml b/.gitea/workflows/python.yaml new file mode 100644 index 0000000..77fdf23 --- /dev/null +++ b/.gitea/workflows/python.yaml @@ -0,0 +1,38 @@ +name: Python CI +run-name: Python CI for ${{ gitea.repository }} by ${{ gitea.actor }} 🐍 + +on: + push: + pull_request: + +jobs: + python: + runs-on: python-latest + + steps: + - name: Check out repository code + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + cache: "pip" + cache-dependency-path: | + requirements.txt + requirements-dev.txt + pyproject.toml + + - name: Install dependencies + run: | + python -V + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + pip install ruff pytest + + - name: Lint + run: ruff check . + + - name: Run tests + run: pytest -q \ No newline at end of file diff --git a/Dockerfile b/go.Dockerfile similarity index 88% rename from Dockerfile rename to go.Dockerfile index 3ca404b..00d70f6 100644 --- a/Dockerfile +++ b/go.Dockerfile @@ -1,6 +1,6 @@ FROM golang:1.26-alpine AS builder WORKDIR /app -COPY . . +COPY go.mod main.go ./ RUN go build -o gitea-runner main.go FROM alpine:latest diff --git a/main.py b/main.py new file mode 100644 index 0000000..cf36e07 --- /dev/null +++ b/main.py @@ -0,0 +1,7 @@ +def test(): + assert 1 + 1 == 2 + + +if __name__ == "__main__": + test() + print("All tests passed!")