Skip to content

Commit

Permalink
ci: speed up PR unit-test run time (#614)
Browse files Browse the repository at this point in the history
Co-authored-by: Yaniv Davidi <yaniv@aspecto.io>
  • Loading branch information
Amir Blum and Yaniv Davidi committed Aug 17, 2021
1 parent 55301c9 commit d7f458f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/unit-test.yml
Expand Up @@ -103,17 +103,22 @@ jobs:
plugins/web/*/node_modules
propagators/*/node_modules
key: ${{ runner.os }}-${{ matrix.container }}-${{ hashFiles('**/package.json') }}
- name: Legacy Peer Dependencies for npm 7
if: matrix.container == 'node:16'
run: npm config set legacy-peer-deps=true
- name: Install Root Dependencies
run: npm install --ignore-scripts
- name: Fix npm cache permissions
run: chown -R 1001:121 "/github/home/.npm"
run: |
chown -R 1001:121 "/github/home/.npm"
[ -e /__w/opentelemetry-js-contrib/opentelemetry-js-contrib/package-lock.json ] && chown 1001:121 /__w/opentelemetry-js-contrib/opentelemetry-js-contrib/package-lock.json
- name: Bootstrap Dependencies
run: npx lerna bootstrap --no-ci
run: npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
- name: Unit tests
run: npm run test
run: npm run test:ci:changed
- name: Report Coverage
if: matrix.container == 'node:14'
run: npm run codecov
run: npm run codecov:ci:changed
browser-tests:
runs-on: ubuntu-latest
container:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -18,10 +18,12 @@
"version:update": "lerna run version:update",
"compile": "lerna run compile",
"test": "lerna run test",
"test:ci:changed": "lerna run test --since origin/main --parallel",
"test:browser": "lerna run test:browser",
"bootstrap": "lerna bootstrap --no-ci",
"bump": "lerna publish",
"codecov": "lerna run codecov",
"codecov:ci:changed": "lerna run codecov --since origin/main --parallel",
"codecov:browser": "lerna run codecov:browser",
"changelog": "lerna-changelog",
"lint": "lerna run lint",
Expand Down

0 comments on commit d7f458f

Please sign in to comment.