From 5505ac19ba4794d43d50e23de49a3b2478a26509 Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Wed, 8 Jul 2026 14:34:36 +0200 Subject: [PATCH] refactor(ci): add python workflow, split cpp jobs, add clang-format --- .gitea/workflows/cpp.yml | 35 +++++++++++- .gitea/workflows/python.yml | 109 ++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/python.yml diff --git a/.gitea/workflows/cpp.yml b/.gitea/workflows/cpp.yml index 32c6a38..ac61783 100644 --- a/.gitea/workflows/cpp.yml +++ b/.gitea/workflows/cpp.yml @@ -4,10 +4,43 @@ on: pull_request: jobs: + fmt: + runs-on: alpine + container: + image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Format check + run: | + find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) \ + -not -path './build/*' \ + -exec clang-format -i --style=file {} + + git diff --exit-code + build: runs-on: alpine container: - image: git.aramjonghu.nl/aramjonghu/zshell-ci:latest + image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure + run: cmake -B build -G Ninja -DENABLE_MODULES=plugin -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: ninja -C build + + clang-tidy: + runs-on: alpine + container: + image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest steps: - name: Checkout diff --git a/.gitea/workflows/python.yml b/.gitea/workflows/python.yml new file mode 100644 index 0000000..3609d5d --- /dev/null +++ b/.gitea/workflows/python.yml @@ -0,0 +1,109 @@ +name: Python + +on: + pull_request: + +jobs: + fmt: + runs-on: alpine + container: node:26-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git \ + python3 \ + py3-pip + python3 -m venv .venv + . .venv/bin/activate + pip install --no-cache-dir autopep8 + + - name: Format check + run: | + . .venv/bin/activate + autopep8 --diff --exit-code -r . + + lint: + runs-on: alpine + container: node:26-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git \ + python3 \ + py3-pip + python3 -m venv .venv + . .venv/bin/activate + pip install --no-cache-dir ruff + + - name: Lint + run: | + . .venv/bin/activate + ruff check . + + test: + runs-on: alpine + container: node:26-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git \ + python3 \ + py3-pip \ + py3-pillow \ + build-base + python3 -m venv .venv + . .venv/bin/activate + pip install --no-cache-dir \ + typer \ + pillow \ + materialyoucolor \ + jinja2 \ + pytest + + - name: Test + run: | + . .venv/bin/activate + cd cli + python -m pytest tests/ -v + + buildcheck: + runs-on: alpine + container: node:26-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git \ + python3 \ + py3-pip \ + build-base \ + python3-dev \ + gcc \ + g++ + python3 -m venv .venv + . .venv/bin/activate + pip install --no-cache-dir nuitka + + - name: Nuitka module check + run: | + . .venv/bin/activate + nuitka --module cli/src/zshell/__main__.py