Skip to content

Commit 5ad47df

Browse files
committed
Add tasks and deployment action
1 parent cb427da commit 5ad47df

File tree

2 files changed

+214
-37
lines changed

2 files changed

+214
-37
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+*"
8+
9+
jobs:
10+
deploy:
11+
name: "Deploy to Pub.dev"
12+
permissions:
13+
id-token: write # Required for authentication using OIDC
14+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

.vscode/tasks.json

Lines changed: 200 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,233 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "Dependencies",
5+
"label": "flutter:pub:get",
6+
"detail": "Get dependencies for the project",
7+
"icon": {
8+
"color": "terminal.ansiGreen",
9+
"id": "cloud-download"
10+
},
11+
"dependsOn": [],
12+
"type": "shell",
13+
"command": [
14+
"flutter pub get"
15+
],
16+
"args": [],
17+
"group": {
18+
"kind": "none",
19+
"isDefault": true
20+
},
21+
"problemMatcher": [],
22+
"options": {
23+
"cwd": "${workspaceFolder}"
24+
},
25+
"isBackground": false,
26+
"presentation": {
27+
"reveal": "silent",
28+
"focus": false,
29+
"panel": "shared",
30+
"showReuseMessage": false,
31+
"clear": false,
32+
"group": "dart"
33+
}
34+
},
35+
{
36+
"label": "dart:build_runner:all",
37+
"detail": "Generate code for the project",
38+
"icon": {
39+
"color": "terminal.ansiGreen",
40+
"id": "code"
41+
},
42+
"type": "shell",
43+
"command": [
44+
"dart run build_runner build --delete-conflicting-outputs",
45+
"&& dart format --fix -l 80 lib test"
46+
],
47+
"dependsOn": [
48+
"flutter:pub:get"
49+
],
50+
"args": [],
51+
"group": {
52+
"kind": "none",
53+
"isDefault": true
54+
},
55+
"problemMatcher": [],
56+
"options": {
57+
"cwd": "${workspaceFolder}"
58+
},
59+
"isBackground": false,
60+
"presentation": {
61+
"reveal": "silent",
62+
"focus": false,
63+
"panel": "shared",
64+
"showReuseMessage": false,
65+
"clear": false,
66+
"group": "dart"
67+
}
68+
},
69+
{
70+
"label": "dart:build_runner:dir",
71+
"detail": "Generate code for the directory",
72+
"type": "shell",
73+
"icon": {
74+
"color": "terminal.ansiGreen",
75+
"id": "code"
76+
},
77+
"command": [
78+
"dart run build_runner build --build-filter '${fileDirname}/*.dart'",
79+
"&& dart format --fix -l 80 '${fileDirname}'"
80+
],
81+
"group": {
82+
"kind": "none",
83+
"isDefault": true
84+
},
85+
"problemMatcher": [],
86+
"dependsOn": [
87+
"flutter:pub:get"
88+
],
89+
"isBackground": false,
90+
"presentation": {
91+
"reveal": "silent",
92+
"focus": false,
93+
"panel": "shared",
94+
"showReuseMessage": false,
95+
"clear": false,
96+
"group": "dart"
97+
}
98+
},
99+
{
100+
"label": "dart:build_runner:watch",
101+
"detail": "Watch for changes in the project",
6102
"type": "shell",
103+
"icon": {
104+
"color": "terminal.ansiGreen",
105+
"id": "code"
106+
},
7107
"command": [
8-
"(flutter pub get)",
9-
"&& (flutter pub get --directory=example)"
108+
"dart run build_runner watch --build-filter \"${input:directory}/**/*.dart\""
10109
],
11110
"group": {
12111
"kind": "none",
13112
"isDefault": true
14113
},
15-
"problemMatcher": []
114+
"problemMatcher": [],
115+
"dependsOn": [
116+
"flutter:pub:get"
117+
],
118+
"isBackground": false,
119+
"presentation": {
120+
"reveal": "silent",
121+
"focus": false,
122+
"panel": "shared",
123+
"showReuseMessage": false,
124+
"clear": false,
125+
"group": "dart"
126+
}
16127
},
17128
{
18-
"label": "Format",
129+
"label": "dart:format",
130+
"detail": "Format all files in the project",
131+
"icon": {
132+
"color": "terminal.ansiGreen",
133+
"id": "lightbulb-autofix"
134+
},
19135
"type": "shell",
20136
"command": [
21-
"dart format --fix -l 80"
137+
"dart format --fix -l 80 lib test"
22138
],
139+
"dependsOn": [],
140+
"args": [],
23141
"group": {
24142
"kind": "none",
25143
"isDefault": true
26144
},
27-
"problemMatcher": []
145+
"problemMatcher": [],
146+
"options": {
147+
"cwd": "${workspaceFolder}"
148+
},
149+
"isBackground": false,
150+
"presentation": {
151+
"reveal": "silent",
152+
"focus": false,
153+
"panel": "shared",
154+
"showReuseMessage": false,
155+
"clear": false,
156+
"group": "dart"
157+
}
28158
},
29159
{
30-
"label": "Clear example build",
160+
"label": "flutter:test:all",
161+
"detail": "Run all tests",
162+
"icon": {
163+
"color": "terminal.ansiGreen",
164+
"id": "bug",
165+
},
166+
"dependsOn": [
167+
"flutter:pub:get"
168+
],
31169
"type": "shell",
32-
"command": "make clear-client",
33-
"windows": {
34-
"command": "powershell.exe",
35-
"args": [
36-
"-NoProfile",
37-
"-ExecutionPolicy",
38-
"Bypass",
39-
"-Command",
40-
"Remove-Item -Path '${workspaceFolder}\\example\\build' -Recurse -Force -ErrorAction Ignore"
41-
]
42-
/* "options": {
43-
"shell": {
44-
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
45-
}
46-
} */
47-
},
48-
"linux": {
49-
"command": "rm -rf",
50-
"args": [
51-
"${workspaceFolder}/example/build"
52-
]
53-
},
54-
"osx": {
55-
"command": "rm -rf",
56-
"args": [
57-
"${workspaceFolder}/example/build"
58-
]
170+
"command": [
171+
"flutter test --color --coverage --concurrency=50 --platform=tester --reporter=expanded --timeout=30s test/unit_test.dart test/widget_test.dart"
172+
],
173+
"args": [],
174+
"group": {
175+
"kind": "test",
176+
"isDefault": true
59177
},
60178
"problemMatcher": [],
179+
"options": {
180+
"cwd": "${workspaceFolder}"
181+
},
182+
"isBackground": false,
61183
"presentation": {
62184
"reveal": "always",
63-
"panel": "shared"
185+
"focus": false,
186+
"panel": "shared",
187+
"showReuseMessage": false,
188+
"clear": false,
189+
"group": "dart"
190+
}
191+
},
192+
{
193+
"label": "flutter:test:feature",
194+
"detail": "Run tests for a specific feature",
195+
"icon": {
196+
"color": "terminal.ansiGreen",
197+
"id": "bug",
64198
},
199+
"dependsOn": [
200+
"flutter:pub:get"
201+
],
202+
"type": "shell",
203+
"command": [
204+
"flutter test --color --coverage --concurrency=50 --platform=tester --reporter=expanded --timeout=30s --tags=\"${input:featureName}\" test/unit_test.dart test/widget_test.dart"
205+
],
206+
"args": [],
65207
"group": {
66-
"kind": "build",
208+
"kind": "test",
67209
"isDefault": true
210+
},
211+
"problemMatcher": [],
212+
"options": {
213+
"cwd": "${workspaceFolder}"
214+
},
215+
"isBackground": false,
216+
"presentation": {
217+
"reveal": "always",
218+
"focus": false,
219+
"panel": "shared",
220+
"showReuseMessage": false,
221+
"clear": false,
222+
"group": "dart"
68223
}
69224
}
225+
],
226+
"inputs": [
227+
{
228+
"id": "featureName",
229+
"type": "promptString",
230+
"description": "Enter the feature name (e.g., 'my_feature_name'):",
231+
/* "default": "my_feature_name" */
232+
}
70233
]
71234
}

0 commit comments

Comments
 (0)