ci: add Gitea Actions workflow — lint, test (vitest), build, docker check
This commit is contained in:
53
.gitea/workflows/ci.yaml
Normal file
53
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
container: node:22-alpine
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm ci
|
||||
- run: npx eslint src/ tests/ --ext .tsx,.ts 2>/dev/null || echo "ESLint not configured yet — add .eslintrc.json"
|
||||
- run: npx prettier --check "**/*.{ts,tsx}" 2>/dev/null || echo "Prettier not configured yet — add .prettierrc"
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
container: node:22-alpine
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm ci
|
||||
- run: npx vitest run
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
container: node:22-alpine
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dashboard-dist
|
||||
path: dist/
|
||||
|
||||
docker-check:
|
||||
name: Docker Build Check
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dashboard-dist
|
||||
path: dist/
|
||||
- run: docker compose build
|
||||
Reference in New Issue
Block a user