From e84e4a5a9dc28eab35c650a4b0e5b1dc54de6f3d Mon Sep 17 00:00:00 2001 From: Mathis HERRIOT <197931332+0x485254@users.noreply.github.com> Date: Tue, 20 Jan 2026 10:52:58 +0100 Subject: [PATCH] chore(ci): add new workflow for linting and testing components --- .gitea/workflows/ci.yml | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..07467a9 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,67 @@ +name: CI (Lint & Test) + +on: + push: + branches-ignore: + - main + tags-ignore: + - 'v*' + paths: + - 'backend/**' + - 'frontend/**' + - 'documentation/**' + pull_request: + paths: + - 'backend/**' + - 'frontend/**' + - 'documentation/**' + +jobs: + validate: + name: Validate ${{ matrix.component }} + runs-on: ubuntu-latest + strategy: + matrix: + component: [backend, frontend, documentation] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> "${GITEA_OUTPUT:-$GITHUB_OUTPUT}" + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile --prefer-offline + + - name: Lint ${{ matrix.component }} + run: pnpm -F @memegoat/${{ matrix.component }} lint + + - name: Test ${{ matrix.component }} + if: matrix.component == 'backend' || matrix.component == 'frontend' + run: | + if pnpm -F @memegoat/${{ matrix.component }} run | grep -q "test"; then + pnpm -F @memegoat/${{ matrix.component }} test + else + echo "No test script found for ${{ matrix.component }}, skipping." + fi