Skip to content

Commit

Permalink
fix(ci): update config file (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Aug 19, 2021
1 parent 6a6f7f6 commit 4673f00
Showing 1 changed file with 44 additions and 4 deletions.
48 changes: 44 additions & 4 deletions .circleci/config.yml
@@ -1,3 +1,5 @@
version: 2.1

aliases:
- &install_yarn_version
name: Install specific Yarn version
Expand All @@ -20,6 +22,19 @@ aliases:
name: Install dependencies
command: yarn install --frozen-lockfile

- &restore_dist_folders
name: Restore dist folders
command: |
set -exu
mkdir -p packages/docsearch-react/dist
mkdir -p packages/docsearch-js/dist
mkdir -p packages/docsearch-css/dist
cp -R /tmp/workspace/packages/docsearch-react/dist packages/docsearch-react
cp -R /tmp/workspace/packages/docsearch-js/dist packages/docsearch-js
cp -R /tmp/workspace/packages/docsearch-css/dist packages/docsearch-css
defaults: &defaults
working_directory: ~/docsearch
docker:
Expand All @@ -33,10 +48,14 @@ cypress: &cypress
## this enables colors in the output
TERM: xterm

version: 2.1
references:
workspace_root: &workspace_root /tmp/workspace
attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root

jobs:
test_build:
build:
<<: *defaults
steps:
- checkout
Expand All @@ -49,14 +68,32 @@ jobs:
command: |
yarn run build
yarn run test:size
- run:
name: Move dist folders to workspace
command: |
set -exu
mkdir -p /tmp/workspace/packages/docsearch-react/dist
mkdir -p /tmp/workspace/packages/docsearch-js/dist
mkdir -p /tmp/workspace/packages/docsearch-css/dist
cp -R packages/docsearch-react/dist /tmp/workspace/packages/docsearch-react
cp -R packages/docsearch-js/dist /tmp/workspace/packages/docsearch-js
cp -R packages/docsearch-css/dist /tmp/workspace/packages/docsearch-css
- persist_to_workspace:
root: *workspace_root
paths:
- packages
test_lint:
<<: *defaults
steps:
- checkout
- *attach_workspace
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run: *restore_dist_folders
- run:
name: Linting
command: yarn run lint
Expand Down Expand Up @@ -115,10 +152,13 @@ workflows:
version: 2.1
ci:
jobs:
- test_build
- build
- test_lint:
requires:
- build
- test_types
# TODO: Enable once the test env setup is ready.
# - test_unit
- test_lint
# TODO: Enable again once Cypress is installed on the repo.
# - test_cypress
- release:
Expand Down

0 comments on commit 4673f00

Please sign in to comment.