Use persist_to_workspace feature to avoid rebuilding in test job

This commit is contained in:
Simon Warta
2020-02-06 13:12:14 +01:00
parent 6f454152f6
commit 4c19e007e2
+13 -1
View File
@@ -5,7 +5,9 @@ workflows:
jobs: jobs:
- build - build
- lint - lint
- test - test:
requires:
- build
jobs: jobs:
build: build:
@@ -30,6 +32,10 @@ jobs:
- ~/.cache/yarn - ~/.cache/yarn
- run: - run:
command: yarn build command: yarn build
- persist_to_workspace:
root: .
paths:
- packages/*/build/*
test: test:
machine: machine:
# We can't use a containerized environment since it requires remote docker to start custom containers. # We can't use a containerized environment since it requires remote docker to start custom containers.
@@ -43,6 +49,11 @@ jobs:
- run: # start early for less wait time below - run: # start early for less wait time below
command: ./scripts/cosm/start.sh command: ./scripts/cosm/start.sh
background: true background: true
- attach_workspace:
at: /tmp/builds
- run:
name: Merge build folders into project (merge with hardlinks)
command: cp --recursive --link /tmp/builds/* .
- run: - run:
# The images ubuntu-1604:201903-01 comes with preinstalled nvm, which does not work well with non-login shells # The images ubuntu-1604:201903-01 comes with preinstalled nvm, which does not work well with non-login shells
name: Uninstall nvm name: Uninstall nvm
@@ -75,6 +86,7 @@ jobs:
- run: - run:
environment: environment:
COSMOS_ENABLED: 1 COSMOS_ENABLED: 1
SKIP_BUILD: 1
command: yarn test command: yarn test
- run: - run:
command: ./scripts/cosm/stop.sh command: ./scripts/cosm/stop.sh