From 60bc8e5749661be2969a486fbdc2f438f592a590 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 6 Mar 2026 11:35:02 +0500 Subject: [PATCH] ci: add UI type-check and build job to CI and release workflows --- .gitea/workflows/ci.yaml | 46 +++++++++++++++++++++++++++++------ .gitea/workflows/release.yaml | 27 +++++++++++++++++++- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 7ba6efd..afc6553 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -5,22 +5,23 @@ on: branches: ["main", "master"] paths: - "scraper/**" + - "ui/**" - ".gitea/workflows/**" pull_request: branches: ["main", "master"] paths: - "scraper/**" + - "ui/**" - ".gitea/workflows/**" -defaults: - run: - working-directory: scraper - jobs: - # ── lint & vet ─────────────────────────────────────────────────────────────── + # ── scraper: lint & vet ────────────────────────────────────────────────────── lint: name: Lint runs-on: ubuntu-latest + defaults: + run: + working-directory: scraper steps: - uses: actions/checkout@v4 @@ -35,10 +36,13 @@ jobs: - name: staticcheck run: go tool staticcheck ./... - # ── tests ──────────────────────────────────────────────────────────────────── + # ── scraper: tests ─────────────────────────────────────────────────────────── test: name: Test runs-on: ubuntu-latest + defaults: + run: + working-directory: scraper steps: - uses: actions/checkout@v4 @@ -50,11 +54,14 @@ jobs: - name: Run tests run: go test -race -count=1 -timeout=60s ./... - # ── build binary ───────────────────────────────────────────────────────────── + # ── scraper: build binary ──────────────────────────────────────────────────── build: name: Build runs-on: ubuntu-latest needs: [lint, test] + defaults: + run: + working-directory: scraper steps: - uses: actions/checkout@v4 @@ -75,6 +82,31 @@ jobs: path: scraper/bin/scraper retention-days: 7 + # ── ui: type-check & build ─────────────────────────────────────────────────── + ui: + name: UI + runs-on: ubuntu-latest + defaults: + run: + working-directory: ui + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + cache-dependency-path: ui/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Type check + run: npm run check + + - name: Build + run: npm run build + # ── docker build (& push) ──────────────────────────────────────────────────── # Uncomment once the runner has Docker available and a registry is configured. # diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index af7b835..b30de6e 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -43,11 +43,36 @@ jobs: - name: Run tests run: go test -race -count=1 -timeout=60s ./... + # ── ui: type-check & build ─────────────────────────────────────────────────── + ui: + name: UI + runs-on: ubuntu-latest + defaults: + run: + working-directory: ui + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + cache-dependency-path: ui/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Type check + run: npm run check + + - name: Build + run: npm run build + # ── build & release ────────────────────────────────────────────────────────── release: name: Release runs-on: ubuntu-latest - needs: [lint, test] + needs: [lint, test, ui] steps: - uses: actions/checkout@v4