Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): update config file #1040

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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