Skip to content

Commit

Permalink
chore(repo): switch to using nx orb on circleci workflows (#6505)
Browse files Browse the repository at this point in the history
* chore(repo): switch to using nx orb on circleci workflows

* chore(repo): set proper name of the main branch
  • Loading branch information
meeroslav committed Jul 26, 2021
1 parent 9e82524 commit 1c3397f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 185 deletions.
33 changes: 15 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ dependencies:
cache_directories:
- ~/.cache/yarn

orbs:
nx: nrwl/nx@1.0.0

executors:
linux:
working_directory: *working_directory
Expand Down Expand Up @@ -126,27 +129,24 @@ jobs:
- run:
name: Check Package dependencies
command: yarn depcheck
- run:
name: Get Last Sucessful Workflow Run
command: |
source ./scripts/circleci/get-successful-run.sh << pipeline.project.type >> $CIRCLE_PROJECT_USERNAME $CIRCLE_PROJECT_REPONAME $CIRCLE_BRANCH master false
echo "export BASE_SHA=\"$BASE_SHA\";" >> $BASH_ENV
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Run Builds
command: |
npx nx affected --target=build --base=$BASE_SHA --parallel --max-parallel=3
npx nx affected --target=build --base=$NX_BASE --parallel --max-parallel=3
- run:
name: Run Unit Tests
command: |
npx nx affected --target=test --base=$BASE_SHA --parallel --max-parallel=2
npx nx affected --target=test --base=$NX_BASE --parallel --max-parallel=2
- run:
name: Run Linting
command: |
npx nx affected --target=lint --base=$BASE_SHA --parallel --max-parallel=4
npx nx affected --target=lint --base=$NX_BASE --parallel --max-parallel=4
- run:
name: Run E2E Tests
command: |
npx nx affected --target=e2e --base=$BASE_SHA
npx nx affected --target=e2e --base=$NX_BASE
no_output_timeout: 45m
- run:
name: Stop All Running Agents for This CI Run
Expand All @@ -171,23 +171,20 @@ jobs:
steps:
- setup:
os: << parameters.os >>
- run:
name: Get Last Sucessful Workflow Run
command: |
source ./scripts/circleci/get-successful-run.sh << pipeline.project.type >> $CIRCLE_PROJECT_USERNAME $CIRCLE_PROJECT_REPONAME $CIRCLE_BRANCH master false
echo "export BASE_SHA=\"$BASE_SHA\";" >> $BASH_ENV
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Run Builds
command: npx nx affected --target=build --base=$BASE_SHA --parallel --max-parallel=3
command: npx nx affected --target=build --base=$NX_BASE --parallel --max-parallel=3
- run:
name: Run Unit Tests
command: npx nx affected --target=test --base=$BASE_SHA --parallel --max-parallel=2
command: npx nx affected --target=test --base=$NX_BASE --parallel --max-parallel=2
- run:
name: Run Linting
command: npx nx affected --target=lint --base=$BASE_SHA --parallel --max-parallel=4
command: npx nx affected --target=lint --base=$NX_BASE --parallel --max-parallel=4
- run:
name: Run E2E Tests
command: npx nx affected --target=e2e --base=$BASE_SHA
command: npx nx affected --target=e2e --base=$NX_BASE
no_output_timeout: 45m
- run:
name: Stop All Running Agents for This CI Run
Expand Down
115 changes: 0 additions & 115 deletions scripts/circleci/find-successful-workflow.js

This file was deleted.

52 changes: 0 additions & 52 deletions scripts/circleci/get-successful-run.sh

This file was deleted.

1 comment on commit 1c3397f

@vercel
Copy link

@vercel vercel bot commented on 1c3397f Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.