Skip to content

Commit 6adec8f

Browse files
ci: setup scheduled CI job to test repository against the latest builds (#1567)
Use a scheduled job to check the repository against the latest version of @angular/language-service from https://github.com/angular/language-services-builds
1 parent 489d34d commit 6adec8f

File tree

3 files changed

+55
-3
lines changed

3 files changed

+55
-3
lines changed

.circleci/config.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ orbs:
33
node: circleci/[email protected]
44
jobs:
55
build-and-test:
6+
parameters:
7+
dependency_type:
8+
# Whether the test should build using the commit dependency versions or the latest builds.
9+
type: enum
10+
enum: ["package.json", "builds-repo"]
611
docker:
712
- image: cimg/node:14.18.1@sha256:50bd08d36e3b6b1bbc5172705f53630d439b959c94e11cdad7f4810f90c5f598
813
steps:
@@ -20,9 +25,25 @@ jobs:
2025
pkg-manager: yarn
2126
- run: scripts/lint.sh
2227
- run: scripts/format.sh
23-
- run: scripts/build.sh
28+
- run: scripts/build.sh << parameters.dependency_type >>
2429
- run: scripts/test.sh
2530
workflows:
2631
build-and-test:
2732
jobs:
28-
- build-and-test
33+
- build-and-test:
34+
name: build-and-test
35+
dependency_type: "package.json"
36+
buid-and-test-against-builds:
37+
jobs:
38+
- build-and-test:
39+
name: build-and-test-builds-repo
40+
dependency_type: "builds-repo"
41+
triggers:
42+
- schedule:
43+
filters:
44+
branches:
45+
only:
46+
- master
47+
# Runs monitoring jobs at 10:00AM every day.
48+
cron: '0 10 * * *'
49+

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run: yarn install
2525
- run: yarn install --cwd integration/project
2626
- run: cd integration/project && yarn ngcc
27-
- run: scripts/build.sh
27+
- run: scripts/build.sh package.json
2828
- run: xvfb-run -a yarn run test:e2e
2929
if: runner.os == 'Linux'
3030
- run: yarn run test:e2e

scripts/build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
#!/usr/bin/env bash
22

3+
DEPENDENCY_TYPE=$1
4+
USE_PACKAGE_JSON=false
5+
USE_BUILDS_REPO=false
6+
7+
if [ "$DEPENDENCY_TYPE" = "package.json" ]; then
8+
USE_PACKAGE_JSON=true
9+
echo "Using the dependencies defined in package.json"
10+
elif [ "$DEPENDENCY_TYPE" = "builds-repo" ]; then
11+
USE_BUILDS_REPO=true
12+
echo "Use the latest dependency from builds repo."
13+
else
14+
echo "Please provide a valid dependency type as the first argument: 'package.json' or 'builds-repo'"
15+
echo
16+
echo "Usage example:"
17+
echo " $0 package.json"
18+
exit 1;
19+
fi
20+
21+
if [ "$USE_BUILDS_REPO" = true ]; then
22+
for dep in "language-service"; do
23+
echo $(node -e "
24+
const pkgJson = require('./package.json');
25+
pkgJson['dependencies']['@angular/$dep'] = 'https://github.com/angular/$dep-builds.git';
26+
console.log(JSON.stringify(pkgJson));
27+
") > package.json
28+
done
29+
fi
30+
331
set -ex -o pipefail
432

533
# Enable extended pattern matching features
@@ -9,6 +37,9 @@ shopt -s extglob
937
rm -rf dist
1038
rm -rf **/*.tsbuildinfo
1139

40+
41+
yarn install;
42+
1243
# Build the client and server
1344
yarn run compile
1445

0 commit comments

Comments
 (0)