-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
156 lines (137 loc) · 4.66 KB
/
scripts.yaml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
barrel: barreler build
docs:
local: cd doc-site && pnpm start
build: cd doc-site && pnpm i && pnpm build
build_runner:
(aliases): br
build:
(aliases): b
(command): dart run build_runner build --delete-conflicting-outputs
revali_construct:
(aliases): construct
(command): cd packages/revali_construct && {$build_runner:build}
revali_router:
(aliases): router
(command): cd revali_router/revali_router && {$build_runner:build}
revali_server: cd constructs/revali_server && {$build_runner:build}
watch:
(aliases): w
(command): dart run build_runner watch --delete-conflicting-outputs
revali_construct:
(aliases): gen_core
(command): cd packages/revali_construct && {$build_runner:watch}
revali_router:
(aliases): router
(command): cd revali_router/revali_router && {$build_runner:watch}
revali_server: cd constructs/revali_server && {$build_runner:watch}
test:
(command):
- |
rm -rf **/coverage/ || true
sip test -r {--coverage} --recursive --concurrent --no-version-check --test-randomize-ordering-seed random {--bail}
- |
PACKAGES=(revali_router/revali_router)
for DIR in "${PACKAGES[@]}"; do
# split the package name from the path
PACKAGE=$(echo $DIR | cut -d'/' -f2)
cd {scriptsRoot}/$DIR
{$test:_format-coverage}
{$test:_transfer-coverage}
done
_test:
- '{$test:_clear-coverage}'
- sip test {--coverage}
- '{$test:_format-coverage}'
- '{$test:_open-coverage}'
_clear-coverage: |
if [ -z "{--coverage}" ]; then
exit 0
fi
if [ -d coverage ]; then
rm -rf coverage
fi
_format-coverage: |
if [ -z "{--coverage}" ]; then
exit 0
fi
JSON_FILE=coverage/test/.test_optimizer.dart.vm.json
if [ -f "$JSON_FILE" ]; then
format_coverage \
--in="$JSON_FILE" \
--out="coverage/lcov.info" \
--report-on="lib" \
--packages=".dart_tool/package_config.json" \
--lcov \
--base-directory="." \
--ignore-files="**/*.g.dart"
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "🛑 Failed to format coverage report"
exit 1
fi
fi
_open-coverage: |
if [ -z "{--coverage}" ]; then
exit 0
fi
DIR="$(basename $(pwd))"
# uppercase DIR
DIR=$(echo $DIR | tr '[:lower:]' '[:upper:]')
genhtml \
-o coverage/lcov-report coverage/lcov.info \
--exclude="**/*.g.dart" \
--quiet \
--ignore-errors unused,unused \
--legend \
--highlight \
--sort \
--title "$DIR" \
--header-title "$DIR" \
--no-function-coverage \
--sort \
--hierarchical \
--synthesize-missing \
--footer "Generated by 'sip run test $(basename $(pwd)) --coverage'"
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
open coverage/lcov-report/index.html
else
echo ""
echo "🛑 Failed to generate coverage report"
exit 1
fi
_transfer-coverage: |
if [ -z "{--coverage}" ]; then
exit 0
fi
LCOV_PATH="coverage/lcov.info"
if [ -f "$LCOV_PATH" ]; then
mkdir -p "{scriptsRoot}/../../coverage/apps/mobile/$(basename $(pwd))"
cp "$LCOV_PATH" "{scriptsRoot}/../../coverage/apps/mobile/$(basename $(pwd))/lcov.info"
fi
revali_router: |
cd revali_router/revali_router || exit 1
{$test:_test}
revali_router_annotations: |
cd revali_router/revali_router_annotations || exit 1
{$test:_test}
revali_router_core: |
cd revali_router/revali_router_core || exit 1
{$test:_test}
revali: |
cd packages/revali || exit 1
{$test:_test}
revali_annotations: |
cd packages/revali_annotations || exit 1
{$test:_test}
revali_construct: |
cd packages/revali_construct || exit 1
{$test:_test}
revali_core: |
cd packages/revali_core || exit 1
{$test:_test}
spell_check: cspell "./doc-site/docs/**/*" --config ".github/cspell/cspell.json"
publish:
- dart analyze --fatal-infos --fatal-warnings
- cd scripts && dart run lib/prep_for_publish.dart