-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
89 lines (77 loc) · 2.64 KB
/
Taskfile.yml
File metadata and controls
89 lines (77 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: '3'
vars:
RUNTIME: '{{default "win-x64" .RUNTIME}}'
BACKEND_BUILD_DIR: 'frontend/backend'
BACKEND_PROJECT: 'backend/src/SlideGenerator.Presentation/SlideGenerator.Presentation.csproj'
BACKEND_SOLUTION: 'backend/SlideGenerator.slnx'
tasks:
default:
cmds:
- task: build
# ============================================================================
# BUILD TASKS
# ============================================================================
build:
desc: Build the full application (Backend + Frontend)
cmds:
- task: build:backend
- task: build:frontend
build:backend:
desc: Build and publish Backend to frontend resources
cmds:
- echo "Building Backend for {{.RUNTIME}}..."
- dotnet publish {{.BACKEND_PROJECT}} -c Release -r {{.RUNTIME}} -o {{.BACKEND_BUILD_DIR}} --self-contained false
build:frontend:
desc: Build the Frontend
dir: frontend
cmds:
- echo "Building Frontend..."
- npm install
- npm run build
env:
ELECTRON_BUILDER_PUBLISH: never
# ============================================================================
# TEST TASKS
# ============================================================================
test:
desc: Run all tests
cmds:
- task: test:backend
- task: test:frontend
test:backend:
desc: Run Backend unit tests
cmds:
- echo "Running Backend Tests..."
- dotnet restore {{.BACKEND_SOLUTION}}
- dotnet test {{.BACKEND_SOLUTION}} --no-restore --logger "trx;LogFileName=backend-tests.trx" --results-directory backend/TestResults
test:frontend:
desc: Run Frontend unit tests
dir: frontend
cmds:
- echo "Running Frontend Tests..."
- npm install
- mkdir -p test-results
- npm test -- --run --reporter=default --reporter=junit --outputFile=./test-results/junit.xml
# ============================================================================
# MAINTENANCE TASKS
# ============================================================================
format:
desc: Format code for both Backend and Frontend
cmds:
- task: format:backend
- task: format:frontend
format:backend:
dir: backend
cmds:
- dotnet format
format:frontend:
dir: frontend
cmds:
- npm run format
clean:
desc: Clean build artifacts
cmds:
- cmd: rm -rf frontend/backend frontend/dist frontend/release backend/TestResults
platforms: [linux, darwin]
- cmd: Remove-Item -Recurse -Force -ErrorAction SilentlyContinue frontend/backend, frontend/dist, frontend/release, backend/TestResults
platforms: [windows]