Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0503c22
Update yarn to v3.2
peterMuriuki Apr 7, 2022
a3e66f5
Trying to understand symlink in yarn3
peterMuriuki Apr 7, 2022
4255155
Rethinking cache
peterMuriuki Apr 7, 2022
655892d
Add iinteractive-tools plugin
peterMuriuki Apr 7, 2022
18f1ddb
Revert to yarn v1.18
peterMuriuki Apr 8, 2022
5ac7924
Fix dependencies and update readme
peterMuriuki Apr 8, 2022
44ee828
Code cleanup
peterMuriuki Apr 8, 2022
f9b7aed
Merge branch 'master' into 958-update-yarn
peterMuriuki Apr 8, 2022
d797080
Merge branch '958-update-yarn' of github.com:OpenSRP/web into 958-upd…
peterMuriuki Apr 8, 2022
95ebee2
Update readme
peterMuriuki Apr 8, 2022
93c37d3
Trying to understand memory usage on circle-ci
peterMuriuki Apr 11, 2022
529fd81
Build packages then build app differently
peterMuriuki Apr 11, 2022
f704615
Try increasing Node memory size
peterMuriuki Apr 11, 2022
1c7782c
Attempt to profile memory usage
peterMuriuki Apr 11, 2022
41b6895
Update documentation
peterMuriuki Apr 11, 2022
34b4659
Update react-scripts version to 4.0.3
peterMuriuki Apr 11, 2022
14f0186
Update app/tsconfig
peterMuriuki Apr 11, 2022
9300fd1
Set lerna build concurrency level to 1
peterMuriuki Apr 11, 2022
b392bde
Attempt at redefinint node max space during lerna build
peterMuriuki Apr 11, 2022
e9788e6
Add workflows for build testing and publishing packages
peterMuriuki Oct 13, 2021
36169f0
Merge branch '958-update-yarn' into publish-workflow
peterMuriuki Apr 11, 2022
bdd024a
Temp remove lint step
peterMuriuki Apr 11, 2022
c68561c
Create .env file
peterMuriuki Apr 11, 2022
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
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
environment:
SKIP_PREFLIGHT_CHECK: 'true'
GENERATE_SOURCEMAP: 'false'
NODE_OPTIONS: '--max-old-space-size=4096'

working_directory: ~/web

Expand All @@ -25,14 +26,24 @@ jobs:
- web-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- web-{{ .Environment.CACHE_VERSION }}-dependencies-
- run:
command: |
while true; do
sleep 5
# NOTE: on MacOS, the f argument is not supported.
# In this case, you can drop the f argument instead.
ps auxwwf
echo "======"
done
background: true

- run:
name: Install dependencies
command: yarn install

- run:
name: build packages
command: yarn lerna:prepublish --concurrency=2
command: export NODE_OPTIONS="--max-old-space-size=8192" && yarn lerna:prepublish --concurrency=1

- save_cache:
paths:
Expand All @@ -50,3 +61,4 @@ jobs:
- run:
name: upload coverage to coveralls
command: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

81 changes: 81 additions & 0 deletions .github/workflows/cd-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build and publish opensrp web
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]

steps:
- name: checkout with tags
uses: actions/checkout@v2
with:
# pulls all comits (needed for lerna / semantic release to correctly)
fetch-depth: "0"
# puls all tags (needed for lerna/ semantic release to correctly version)
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
registry-url: 'https://registry.npmjs.org'
scope: opensrp
env:
NODE_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }}
- run: |
yarn install --frozen-lockfile
yarn lerna:prepublish
- uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Set outputs
id: shortSha
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
- name: Checkout to new publishing branch
run: |
git checkout -b publish-${{ steps.shortSha.outputs.short_sha }}
git branch -v
git push origin publish-${{ steps.shortSha.outputs.short_sha }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate to NPMJS
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm config set scope "@opensrp"
npm config list
env:
CI: true
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- name: Version up commit
run: |
# have to manually cleanup any this branch if no changes are to be added to repo.
yarn lerna version --include-merged-tags --conventional-commits --create-release github --include-merged-tags -y
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish packages
run: yarn lerna publish from-package --ignore-scripts --ignore-prepublish -y --no-verify-access
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
uses: repo-sync/pull-request@v2
id: cpr
with:
source_branch: publish-${{ steps.shortSha.outputs.short_sha }}
destination_branch: "master"
pr_title: "[GH Actions] Publish packages"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: lerna-debug artifacts
if: always()
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: lerna-debug
path: |
lerna-debug.log
lerna-error.log
- name: Remove publish branch
if: steps.cpr.outputs.has_changed_files == "false"
run: git push origin --delete publish-${{ steps.shortSha.outputs.short_sha }}
46 changes: 46 additions & 0 deletions .github/workflows/cd-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build and test opensrp web
on: [ "push", "pull_request" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache-dependency-path: "**/yarn.lock"

- name: cp envs
run: cp app/.env.sample app/.env

- run: yarn install --frozen-lockfile

# - name: Lint
# run: yarn lint

# cache and only build packages that were changed
- name: Build packages
run: yarn lerna:prepublish

- name: Run all tests
run: yarn test --verbose --collectCoverage=true --forceExit --detectOpenHandles
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage
path_to_write_report: ./coverage/codecov_report.txt
verbose: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

Loading