Files
libnovel/.gitea/workflows/ci-scraper.yaml
Admin 54616b82d7
Some checks failed
CI / Scraper / Lint (pull_request) Successful in 35s
CI / Scraper / Test (pull_request) Successful in 15s
CI / Scraper / Build (pull_request) Failing after 10s
CI / UI / Build (pull_request) Successful in 6m31s
ci: split into dedicated scraper and ui workflows
2026-03-06 11:38:28 +05:00

77 lines
2.2 KiB
YAML

name: CI / Scraper
on:
push:
branches: ["main", "master"]
paths:
- "scraper/**"
- ".gitea/workflows/ci-scraper.yaml"
pull_request:
branches: ["main", "master"]
paths:
- "scraper/**"
- ".gitea/workflows/ci-scraper.yaml"
defaults:
run:
working-directory: scraper
jobs:
# ── lint & vet ───────────────────────────────────────────────────────────────
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: scraper/go.mod
cache-dependency-path: scraper/go.sum
- name: go vet
run: go vet ./...
- name: staticcheck
run: go tool staticcheck ./...
# ── tests ────────────────────────────────────────────────────────────────────
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: scraper/go.mod
cache-dependency-path: scraper/go.sum
- name: Run tests
run: go test -race -count=1 -timeout=60s ./...
# ── build binary ─────────────────────────────────────────────────────────────
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: scraper/go.mod
cache-dependency-path: scraper/go.sum
- name: Build binary
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -ldflags="-s -w" -o bin/scraper ./cmd/scraper
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: scraper-linux-amd64
path: scraper/bin/scraper
retention-days: 7