Skip to content

Commit

Permalink
chore: use npm workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tripodsan authored Jun 5, 2022
1 parent 07fd8fb commit 4b1a65a
Show file tree
Hide file tree
Showing 40 changed files with 16,284 additions and 47,496 deletions.
102 changes: 42 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,60 @@
version: 2.1
executors:
node14:
node16:
docker:
- image: cimg/node:14.19
- image: cimg/node:16.15

orbs:
codecov: codecov/codecov@3.2.2

commands:
setup:
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: install latest npm
command: npm -g install npm
- run:
name: Installing Dependencies
command: npm install
- run:
name: Bootstrap Lerna
command: npm run bootstrap
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: prepare test git user
command: git config --global user.email "circleci@example.com" && git config --global user.name "CircleCi Build"
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: install latest npm
command: npm -g install npm
- run:
name: Installing Dependencies
command: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: prepare test git user
command: git config --global user.email "circleci@example.com" && git config --global user.name "CircleCi Build"

jobs:
build:
executor: node14
executor: node16
parallelism: 15

steps:
- setup
- run: mkdir junit
- run:
name: Lint
command: npm run lint-ci
- run:
name: Getting Code Coverage
command: npm run test-ci
- store_test_results:
path: packages/helix-shared-all/junit
- store_test_results:
path: packages/helix-shared-async/junit
- store_test_results:
path: packages/helix-shared-body-data/junit
- store_test_results:
path: packages/helix-shared-config/junit
- store_test_results:
path: packages/helix-shared-dom/junit
- store_test_results:
path: packages/helix-shared-git/junit
- store_test_results:
path: packages/helix-shared-ims/junit
- store_test_results:
path: packages/helix-shared-process-queue/junit
- store_test_results:
path: packages/helix-shared-prune/junit
- store_test_results:
path: packages/helix-shared-string/junit
- store_test_results:
path: packages/helix-shared-utils/junit
- store_test_results:
path: packages/helix-shared-wrap/junit
- store_test_results:
path: packages/helix-shared-indexer/junit
- store_test_results:
path: packages/helix-shared-bounce/junit
- setup
- run:
name: Split package list
command: circleci tests glob "packages/*" | circleci tests split > /tmp/tests-to-run
- run:
name: Lint
command: cat /tmp/tests-to-run | xargs -I % npm run lint -w %
- run:
name: Running tests and getting code coverage
command: cat /tmp/tests-to-run | xargs -I % npm run test -w %
- codecov/upload
- run:
name: Copy test results
command: |
mkdir junit
cat /tmp/tests-to-run | xargs -I % cp %/junit/test-results.xml junit/test-results-$CIRCLE_NODE_INDEX.xml
- store_test_results:
path: junit

workflows:
version: 2
build:
jobs:
- build
- build
5 changes: 2 additions & 3 deletions .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
with:
token: ${{ secrets.MY_GITHUB_TOKEN }}
fetch-depth: 0
- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '16.x'
- name: Configure Git User
run: |
git config --global user.email "ci@example.com"
Expand All @@ -29,7 +29,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
- run: npm ci
- run: npm run bootstrap
- run: npm run lint
- run: npm test
- run: npm run semantic-release
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
16 changes: 16 additions & 0 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md",
}],
"@semantic-release/npm",
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/github", {}]
],
branches: ['main'],
};
31 changes: 0 additions & 31 deletions commitlint.config.js

This file was deleted.

16 changes: 0 additions & 16 deletions lerna.json

This file was deleted.

Loading

0 comments on commit 4b1a65a

Please sign in to comment.