Skip to content

Commit

Permalink
Merge branch 'master' into pr/selector-projection
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Apr 1, 2019
2 parents 3447f87 + 29e7885 commit 26eab59
Show file tree
Hide file tree
Showing 229 changed files with 6,556 additions and 7,361 deletions.
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
155 changes: 112 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,33 @@ 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.8.0
var_1: &cache_key yarn-cache-{{ checksum "yarn.lock" }}-0.9.1
var_2: &run_in_node
docker:
- image: circleci/node:10.12
var_3: &set_bazel_options
run:
command: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
var_4: &docs_cache_key yarn-docs-cache-{{ checksum "~/docs/projects/ngrx.io/yarn.lock" }}-0.1
var_5: &run_in_browser
docker:
- image: circleci/node:10.12-browsers

jobs:
install:
<<: *run_in_node
steps:
- checkout
- restore_cache:
key: *cache_key
- run: yarn --frozen-lockfile --non-interactive
- save_cache:
key: *cache_key
paths:
- ~/.cache/yarn
- ~/.cache/Cypress
- node_modules

# Enforce some static analysis invariants.
# Note that generally, these should be checked only on the delta in each change,
# otherwise any change to the static analysis config requires updating all the
Expand All @@ -30,20 +47,19 @@ jobs:
steps:
- 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:
'yarn buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) ||
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
# Run the Buildifier to check our Bazel rules for format issues.
- run: 'yarn bazel:format --mode=check ||
(echo "BUILD files not formatted. Please run ''yarn bazel:format --mode=fix''" ; exit 1)'

# Run the Buildifier to check our Bazel rules for lint issues.
# Note: The `--lint=warn` will auto fixe (re-write) the affected files.
- run: 'yarn bazel:format --lint=warn ||
(echo "BUILD files contain unresolved lint errors. Please fix manually the remaining errors." ; exit 1)'

bazel:
test:
<<: *run_in_node
steps:
- checkout
Expand All @@ -52,42 +68,55 @@ jobs:
- restore_cache:
key: *cache_key

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

# Install the dependencies from NPM, using the node and yarn binaries managed by Bazel
- 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: yarn bazel test //...
# Store artifacts from build
- persist_to_workspace:
root: dist
paths:
- bin/*
test:
docker:
- image: circleci/node:10.12-browsers
- save_cache:
key: *cache_key
paths:
- ~/.cache/yarn
- ~/.cache/Cypress
- node_modules

schematics-core-check:
<<: *run_in_browser
steps:
- checkout
- restore_cache:
key: *cache_key
- run: yarn
- run: yarn copy:schematics
- run: git diff --name-only --exit-code ./modules
- run: yarn run ci
- run: yarn run example:build:prod

example-tests:
<<: *run_in_browser
steps:
- checkout
- restore_cache:
key: *cache_key
- run: yarn run example:test --watch=false
- save_cache:

example-e2e-tests:
<<: *run_in_browser
steps:
- checkout
- restore_cache:
key: *cache_key
paths:
- ~/.cache/yarn
- node_modules
- run: yarn run example:build:prod
- run: yarn run example:cypress:ci

docs-tests:
<<: *run_in_browser
working_directory: ~/docs/projects/ngrx.io
steps:
- checkout:
path: ~/docs
- restore_cache:
key: *docs_cache_key
- run: yarn test --watch=false

docs:
<<: *run_in_node
Expand All @@ -109,7 +138,6 @@ jobs:
- save_cache:
key: *docs_cache_key
paths:
- ~/.cache/yarn
- ~/docs/projects/ngrx.io/node_modules

docs-preview:
Expand All @@ -118,7 +146,7 @@ jobs:
steps:
- add_ssh_keys:
fingerprints:
- 'c9:c2:b4:5e:13:23:b6:6d:d8:29:3e:68:c6:40:9c:ec'
- "c9:c2:b4:5e:13:23:b6:6d:d8:29:3e:68:c6:40:9c:ec"
- checkout:
path: ~/docs
- restore_cache:
Expand All @@ -132,40 +160,81 @@ jobs:
echo 'export SHORT_GIT_HASH=$(git rev-parse --short $CIRCLE_SHA1)' >> $BASH_ENV
echo 'export CIRCLE_PULL_REQUEST_NUMBER=$(echo "$CIRCLE_PULL_REQUEST" | cut -d"/" -f7)' >> $BASH_ENV
source $BASH_ENV
- run: yarn setup
- run: npm rebuild node-sass
- run: yarn build-for next --progress false --base-href /pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/ --output-path dist/ngrx.io/pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/ && yarn copy-404-page
- run: cp -rf src/extra-files/next/. dist/ngrx.io/pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/
- run: yarn --cwd ../../ install && yarn --cwd ../../ run deploy:preview
- save_cache:
key: *docs_cache_key
paths:
- ~/docs/projects/ngrx.io/node_modules

deploy:
<<: *run_in_node
steps:
- add_ssh_keys:
fingerprints:
- 'c9:c2:b4:5e:13:23:b6:6d:d8:29:3e:68:c6:40:9c:ec'
- "c9:c2:b4:5e:13:23:b6:6d:d8:29:3e:68:c6:40:9c:ec"
- checkout
- restore_cache:
key: *cache_key
- run: yarn
- attach_workspace:
at: dist
- run: yarn run deploy:builds

cleanup-previews:
<<: *run_in_node
steps:
- add_ssh_keys:
fingerprints:
- "c9:c2:b4:5e:13:23:b6:6d:d8:29:3e:68:c6:40:9c:ec"
- checkout
- restore_cache:
key: *cache_key
- run: yarn run cleanup:previews

workflows:
version: 2
build-test-deploy:
jobs:
- lint
- bazel
- test
- docs
- docs-preview
- install
- lint:
requires:
- install
- test:
requires:
- install
- example-tests:
requires:
- install
- example-e2e-tests:
requires:
- install
- docs-tests:
requires:
- install
- docs:
requires:
- install
- docs-preview:
requires:
- install
- schematics-core-check:
requires:
- install
- deploy:
requires:
- docs
- example-tests
- example-e2e-tests
- docs-tests
- test
- bazel
filters:
branches:
only: master
- cleanup-previews:
requires:
- install
filters:
branches:
only: master
5 changes: 0 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ exports_files([
"tsconfig.json",
"LICENSE",
])

alias(
name = "install",
actual = "@nodejs//:yarn",
)
Loading

0 comments on commit 26eab59

Please sign in to comment.