build: No longer need to bazel build twice

This commit is contained in:
Alex Eagle 2017-06-20 21:08:20 -07:00 committed by Matias Niemelä
parent 7395a64668
commit 08ecfd891d
2 changed files with 10 additions and 16 deletions

View File

@ -15,28 +15,23 @@ jobs:
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge" post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
- restore_cache: - restore_cache:
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }} key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
- run: npm install - run: npm install
- run: npm run postinstall
- save_cache:
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
paths:
- "node_modules"
- run: ./node_modules/.bin/gulp lint - run: ./node_modules/.bin/gulp lint
build: build:
<<: *defaults <<: *defaults
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }} key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
- run: npm install
- run: npm run postinstall - run: bazel run @io_bazel_rules_typescript_node//:bin/npm install
- run: bazel build ...
- save_cache: - save_cache:
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }} key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
paths: paths:
- "node_modules" - "node_modules"
# Build twice, workaround for
# https://github.com/bazelbuild/bazel/issues/3114
- run: bazel build ... || bazel build ...
workflows: workflows:
version: 2 version: 2

View File

@ -1,12 +1,11 @@
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository( git_repository(
name = "io_bazel_rules_typescript", name = "io_bazel_rules_typescript",
remote = "https://github.com/bazelbuild/rules_typescript.git", remote = "https://github.com/bazelbuild/rules_typescript.git",
commit = "804c5da", commit = "3a8404d",
) )
load("@io_bazel_rules_typescript//:defs.bzl", "node_repositories", "npm_install") load("@io_bazel_rules_typescript//:defs.bzl", "node_repositories")
node_repositories() node_repositories(package_json = "//:package.json")
npm_install(package_json = "//:package.json")