Skip to content

Commit

Permalink
build: use Bazel installed from npm
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Nov 19, 2018
1 parent 6f54ccf commit 6f231ca
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
18 changes: 11 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ version: 2
# See https://blog.daemonl.com/2016/02/yaml.html
# To validate changes, use an online parser, eg.
# https://yaml-online-parser.appspot.com/
var_1: &cache_key yarn-cache-{{ checksum "yarn.lock" }}-0.7.0
var_1: &cache_key yarn-cache-{{ checksum "yarn.lock" }}-0.8.0
var_2: &run_in_ngcontainer
docker:
- image: angular/ngcontainer:0.7.0
- image: circleci/node:10.12
var_3: &set_bazel_options
run:
command: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
Expand All @@ -31,12 +31,16 @@ jobs:
- checkout
- *set_bazel_options

- restore_cache:
key: *cache_key

# Enforce that BUILD files are formatted.
# Note that this uses the version of buildifier from the docker image -
# take care that you use the same version when you run
# buildifier locally on your change.
- run: yarn
- run:
'buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) ||
'yarn bazel buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) ||
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'

bazel:
Expand All @@ -50,17 +54,17 @@ jobs:

# Helpful for debugging, so you can check you have the same bazel version when you need
# to reproduce a failure.
- run: bazel info release
- run: yarn
- run: yarn bazel info release

# Install the dependencies from NPM, using the node and yarn binaries managed by Bazel
- run: yarn
- run: bazel run @nodejs//:yarn
- run: yarn bazel run @nodejs//:yarn

# Build and Test
# Use bazel query so that we explicitly ask for all buildable targets to
# be built even though we run `bazel test`
# See https://github.com/bazelbuild/bazel/issues/4257
- run: bazel query --output=label //... | xargs bazel test
- run: yarn bazel test //...
# Store artifacts from build
- persist_to_workspace:
root: dist
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "monorepo for ngrx development",
"scripts": {
"precommit": "lint-staged",
"build": "bazel build ...",
"build": "yarn bazel build ...",
"deploy:builds": "ts-node ./build/deploy-build.ts",
"deploy:preview": "ts-node ./build/deploy-preview.ts",
"test:unit": "node ./tests.js",
Expand All @@ -22,9 +22,9 @@
"watch:tests": "chokidar 'modules/**/*.ts' --initial -c 'yarn run test:unit'",
"postinstall": "opencollective postinstall",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
"preskylint": "yarn bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
"skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" ! -path \"./dist/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint --disable-checks=deprecated-api",
"prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
"prebuildifier": "yarn bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
"buildifier": "find . -type f \\( -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/com_github_bazelbuild_buildtools/buildifier/*/buildifier",
"copy:schematics": "ts-node ./build/copy-schematics-core.ts",
"build:stackblitz": "ts-node ./build/stackblitz.ts && git add ./stackblitz.html"
Expand Down Expand Up @@ -91,6 +91,7 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.10.0",
"@bazel/bazel": "^0.19.1",
"@octokit/rest": "^15.17.0",
"@types/fs-extra": "^2.1.0",
"@types/glob": "^5.0.33",
Expand Down
24 changes: 24 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,30 @@
dependencies:
tslib "^1.9.0"

"@bazel/bazel-darwin_x64@0.19.1":
version "0.19.1"
resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.19.1.tgz#58d779c8938bd1c136cab55e2f6473121f83741b"
integrity sha512-Rnk8zw5S9SZfuMQsGRodm7ZXme1FS2rpmYbIJVF0M+k7jaWLZJwV2w5T2vMyuluEjOxTbptXenbigTF80jETIA==

"@bazel/bazel-linux_x64@0.19.1":
version "0.19.1"
resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.19.1.tgz#aef363e0932d29d1bb48980da139d74bfb4b1ffb"
integrity sha512-dWKKYa0cwDEjVRRwUMVSy1WvQjTHQPiwrA6mDzNzoRX0D0KBX25QqdkQW6HS6fzyEOsFjT+yVtfqtxL0qO+FCA==

"@bazel/bazel-win32_x64@0.19.1":
version "0.19.1"
resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.19.1.tgz#273c43b0febc11675614c402ec82ae44b519f9ee"
integrity sha512-t6vOh2IOzUAk19ccS0q3Kho364Yxjtjv1v4utAjOSNw8GVwutfekdiojGBrR8ihvJi1Xp885mOkQnZA38B9tvQ==

"@bazel/bazel@^0.19.1":
version "0.19.1"
resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.19.1.tgz#22ce225b5172a4ad2a94496be66b14b7c7facca2"
integrity sha512-RGxp/Ny36ESzBG7l3yYG24yWfvjFyGE2VqNtXZdJfCfO5312zTNz0qRmZS8pNrCEN+F89jQDRvPhpdAyXKKwOg==
optionalDependencies:
"@bazel/bazel-darwin_x64" "0.19.1"
"@bazel/bazel-linux_x64" "0.19.1"
"@bazel/bazel-win32_x64" "0.19.1"

"@bazel/typescript@^0.20.3":
version "0.20.3"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.20.3.tgz#51dcc369c2af0d7f2311d6e692d07776492060f4"
Expand Down

0 comments on commit 6f231ca

Please sign in to comment.