Skip to content

Commit

Permalink
monorepo with yarn workspaces and lerna
Browse files Browse the repository at this point in the history
Signed-off-by: Onur Sumer <s.onur.sumer@gmail.com>
  • Loading branch information
onursumer committed Dec 20, 2019
1 parent dbe01ee commit ea917f9
Show file tree
Hide file tree
Showing 282 changed files with 8,289 additions and 1,321 deletions.
30 changes: 4 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run_e2e_and_save_artifacts: &run_e2e_and_save_artifacts
- run:
name: "Install yarn at specific version"
command:
sudo npm install --global yarn@1.13.0
sudo npm install --global yarn@1.21.1
- attach_workspace:
at: /tmp/
- run:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- run:
name: "Install yarn at specific version"
command:
sudo npm install --global yarn@1.13.0
sudo npm install --global yarn@1.21.1
- run:
name: "Show yarn and node versions"
command: |
Expand All @@ -89,6 +89,7 @@ jobs:
- v2-dependencies-{{ checksum "yarn.lock" }}
# Download and cache dependencies
- run: yarn
- run: yarn buildModules
- run:
name: "Make sure lock file is still the same"
command: 'git diff --exit-code yarn.lock > /dev/null || (echo -e "New package lock file at $(cat yarn.lock | curl -F c=@- https://ptpb.pw | grep url) (include this file in your PR to fix this test)"; git diff --exit-code yarn.lock; exit 1)'
Expand Down Expand Up @@ -127,7 +128,7 @@ jobs:
- run:
name: "Install yarn at specific version"
command:
sudo npm install --global yarn@1.13.0
sudo npm install --global yarn@1.21.1
- attach_workspace:
at: /tmp/
# run tests!
Expand All @@ -153,23 +154,6 @@ jobs:
# Ignore doTest.only in oql parser
- run: "! grep '\\.only' $(find ./src ./end-to-end-test -type f -name '*spec*' | grep -v node_modules) | grep -v 'doTest.only = function' | grep -v expectedParsedResult"

public_lib:
<<: *defaults
steps:
- run:
name: "Install yarn at specific version"
command:
sudo npm install --global yarn@1.13.0
- attach_workspace:
at: /tmp/
# build public lib
- run:
command: "yarn run buildPublicLib"
environment:
DISABLE_SOURCEMAP: true
NO_PARALLEL: true
when: always

end_to_end_tests:
<<: *defaults
environment:
Expand Down Expand Up @@ -262,9 +246,6 @@ workflows:
install_and_test:
jobs:
- install
- public_lib:
requires:
- install
- unit_tests:
requires:
- install
Expand All @@ -291,9 +272,6 @@ workflows:
- rc
jobs:
- install
- public_lib:
requires:
- install
- api_sync:
requires:
- install
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/module-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Publish modules under packages directory to npm registry
name: Module Publish

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
# only publish modules under packages
paths:
- "packages/**/*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '8.12.0'
registry-url: 'https://registry.npmjs.org'
- run: yarn policies set-version 1.21.1
- run: yarn
- run: yarn buildModules
- run: yarn publishModules
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
npm-debug.log
yarn-error.log
lerna-debug.log
.env
.awsDetails
.idea/**
Expand All @@ -11,7 +12,7 @@ stats.json
tsDist/
dist/
common-dist/
commons-dist/
packages/cbioportal-frontend-commons/dist
.sass-cache
.rpt2_cache
frontend-cbioportal.iml
Expand All @@ -20,6 +21,8 @@ test/
.project
.settings
.vscode
.yarn
.yarnrc
node
bin
target
Expand Down
Loading

0 comments on commit ea917f9

Please sign in to comment.