ci: add UI type-check and build job to CI and release workflows
This commit is contained in:
@@ -5,22 +5,23 @@ on:
|
|||||||
branches: ["main", "master"]
|
branches: ["main", "master"]
|
||||||
paths:
|
paths:
|
||||||
- "scraper/**"
|
- "scraper/**"
|
||||||
|
- "ui/**"
|
||||||
- ".gitea/workflows/**"
|
- ".gitea/workflows/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main", "master"]
|
branches: ["main", "master"]
|
||||||
paths:
|
paths:
|
||||||
- "scraper/**"
|
- "scraper/**"
|
||||||
|
- "ui/**"
|
||||||
- ".gitea/workflows/**"
|
- ".gitea/workflows/**"
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: scraper
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ── lint & vet ───────────────────────────────────────────────────────────────
|
# ── scraper: lint & vet ──────────────────────────────────────────────────────
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: scraper
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -35,10 +36,13 @@ jobs:
|
|||||||
- name: staticcheck
|
- name: staticcheck
|
||||||
run: go tool staticcheck ./...
|
run: go tool staticcheck ./...
|
||||||
|
|
||||||
# ── tests ────────────────────────────────────────────────────────────────────
|
# ── scraper: tests ───────────────────────────────────────────────────────────
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: scraper
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -50,11 +54,14 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -race -count=1 -timeout=60s ./...
|
run: go test -race -count=1 -timeout=60s ./...
|
||||||
|
|
||||||
# ── build binary ─────────────────────────────────────────────────────────────
|
# ── scraper: build binary ────────────────────────────────────────────────────
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [lint, test]
|
needs: [lint, test]
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: scraper
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -75,6 +82,31 @@ jobs:
|
|||||||
path: scraper/bin/scraper
|
path: scraper/bin/scraper
|
||||||
retention-days: 7
|
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) ────────────────────────────────────────────────────
|
# ── docker build (& push) ────────────────────────────────────────────────────
|
||||||
# Uncomment once the runner has Docker available and a registry is configured.
|
# Uncomment once the runner has Docker available and a registry is configured.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -43,11 +43,36 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -race -count=1 -timeout=60s ./...
|
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 ──────────────────────────────────────────────────────────
|
# ── build & release ──────────────────────────────────────────────────────────
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [lint, test]
|
needs: [lint, test, ui]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user