mirror of
https://git.freecumextremist.com/grumbulon/pomme.git
synced 2024-11-22 05:03:45 +00:00
Add frontend testing, add frontend test to pipeline
This commit is contained in:
parent
5ee838e405
commit
5cc50e8138
3 changed files with 21 additions and 8 deletions
19
.drone.yaml
19
.drone.yaml
|
@ -5,10 +5,11 @@ name: pomme-pipeline
|
|||
|
||||
steps:
|
||||
- name: lint-frontend
|
||||
image: guergeiro/pnpm
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- cd frontend && npm i
|
||||
- cd .. && make frontend
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@latest --activate
|
||||
- pnpm -F frontend install
|
||||
- make lint-frontend
|
||||
- name: lint-backend
|
||||
image: golangci/golangci-lint
|
||||
|
@ -18,17 +19,23 @@ steps:
|
|||
image: golang:1.20
|
||||
commands:
|
||||
- go mod tidy && go mod vendor
|
||||
depends_on:
|
||||
depends_on:
|
||||
- 'lint-backend'
|
||||
- 'lint-frontend'
|
||||
volumes:
|
||||
- name: 'cache'
|
||||
- path: '/go'
|
||||
- name: 'test'
|
||||
- name: test-frontend
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- pnpm -F frontend test:unit
|
||||
depends_on:
|
||||
- 'cache'
|
||||
- name: test-backend
|
||||
image: golang:1.20
|
||||
commands:
|
||||
- cp config.sample.yaml ./internal/api/config.yaml
|
||||
- 'make test-backend'
|
||||
- make test-backend
|
||||
depends_on:
|
||||
- 'cache'
|
||||
volumes:
|
||||
|
|
8
Makefile
8
Makefile
|
@ -30,7 +30,7 @@ format-backend:
|
|||
gofmt -w -s .
|
||||
|
||||
swagger:
|
||||
swag init -d cmd/pomme/,internal/
|
||||
swag init -d cmd/pomme/,internal/
|
||||
|
||||
.PHONY: lint lint-frontend lint-backend
|
||||
lint: lint-frontend lint-backend
|
||||
|
@ -41,5 +41,11 @@ lint-frontend:
|
|||
lint-backend:
|
||||
golangci-lint run --timeout=5m --out-format colored-line-number:stdout
|
||||
|
||||
.PHONY: test test-frontend test-backend
|
||||
test: test-frontend test-backend
|
||||
|
||||
test-frontend:
|
||||
pnpm -F frontend "test:unit"
|
||||
|
||||
test-backend:
|
||||
go test -v -cover ./internal/api
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"test": "playwright test",
|
||||
"check": "svelte-kit sync && svelte-check",
|
||||
"check:watch": "svelte-kit sync && svelte-check --watch",
|
||||
"test:unit": "vitest",
|
||||
"test:unit": "vitest run",
|
||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||
"format": "prettier --plugin-search-dir . --write ."
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue