Skip to content

Commit 22254dc

Browse files
jelbournkara
authored andcommitted
chore: add extract_metadata task to CI (#859)
1 parent 25b4f21 commit 22254dc

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ env:
3737
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
3838
- MODE=lint
3939
- MODE=circular_deps
40+
- MODE=extract_metadata
4041
- MODE=e2e
4142
- MODE=saucelabs_required
4243
- MODE=browserstack_required

scripts/ci/build-and-test.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ source scripts/ci/sources/mode.sh
1111
source scripts/ci/sources/tunnel.sh
1212

1313
start_tunnel
14-
npm run build
15-
npm run inline-resources
1614

1715
wait_for_tunnel
1816
if is_lint; then
1917
npm run tslint
2018
npm run ci:forbidden-identifiers
2119
npm run stylelint
2220
elif is_circular_deps_check; then
21+
# Build first because madge needs the JavaScript output.
22+
ng build
2323
npm run check-circular-deps
2424
elif is_e2e; then
2525
# Start up the e2e app. This will take some time.
@@ -32,12 +32,24 @@ elif is_e2e; then
3232
echo "Waiting for e2e app to start"
3333
while [ ! -f ./dist/components/button/button.js ]; do
3434
sleep 2
35+
echo -n ".."
3536
done
3637

38+
echo "\nInlining resources"
39+
npm run inline-resources
40+
3741
# Run the e2e tests on the served e2e app.
3842
echo "Starting e2e tests"
3943
ng e2e
44+
elif is_extract_metadata; then
45+
# Run `tsc` first so that the directory structure in dist/ matches what ngc expects.
46+
./node_modules/.bin/tsc -p ./src/demo-app/
47+
./node_modules/.bin/ngc -p ./src/demo-app/
4048
else
49+
# Unit tests
50+
npm run build
51+
npm run inline-resources
52+
4153
karma start test/karma.conf.js --single-run --no-auto-watch --reporters='dots'
4254
fi
4355
teardown_tunnel

scripts/ci/sources/mode.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ is_lint() {
1212
is_circular_deps_check() {
1313
[[ "$MODE" = circular_deps ]]
1414
}
15+
16+
is_extract_metadata() {
17+
[[ "$MODE" = extract_metadata ]]
18+
}

0 commit comments

Comments
 (0)