Skip to content

Commit 7e423a9

Browse files
authored
chore: do not check in lockfiles but cache them (#1896)
1 parent 3b5892b commit 7e423a9

File tree

45 files changed

+161
-221645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+161
-221645
lines changed

β€Ž.github/workflows/canary.yamlβ€Ž

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
jobs:
9-
build-and-test:
9+
build-and-deploy:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout πŸ›ŽοΈ
@@ -23,21 +23,34 @@ jobs:
2323
registry-url: https://registry.npmjs.org
2424
scope: '@opentelemetry'
2525

26-
- name: restore lerna
26+
- name: restore lock files
2727
uses: actions/cache@master # must use unreleased master to cache multiple paths
2828
id: cache
2929
with:
30+
# must be done before bootstrap to not include node_modules files in the cache paths
3031
path: |
31-
node_modules
32-
packages/*/node_modules
33-
metapackages/*/node_modules
32+
packages/*/package-lock.json
33+
benchmark/*/package-lock.json
34+
backwards-compatability/*/package-lock.json
35+
metapackages/*/package-lock.json
36+
packages/*/package-lock.json
37+
integration-tests/*/package-lock.json
3438
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
3539

36-
- name: Install and Build πŸ”§
40+
- name: Install root dependencies
41+
run: npm ci --ignore-scripts
42+
43+
- name: Install and Build (cache miss) πŸ”§
3744
if: steps.cache.outputs.cache-hit != 'true'
3845
run: |
39-
npm ci --ignore-scripts
46+
npx lerna bootstrap --no-ci
47+
npm run compile
48+
49+
- name: Install and Build (cache hit) πŸ”§
50+
if: steps.cache.outputs.cache-hit == 'true'
51+
run: |
4052
npx lerna bootstrap
53+
npm run compile
4154
4255
- name: Publish
4356
run: npx lerna publish --canary --yes

β€Ž.github/workflows/docs.ymlβ€Ž

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy docs on a new release
1+
name: Deploy API Documentation
22

33
on:
44
release:
@@ -11,10 +11,30 @@ jobs:
1111
- name: Checkout πŸ›ŽοΈ
1212
uses: actions/checkout@v2
1313

14-
- name: Install Dependencies
15-
run: |
16-
npm ci --ignore-scripts
17-
npx lerna bootstrap --scope @opentelemetry/api --include-dependencies
14+
- name: restore lock files
15+
uses: actions/cache@master # must use unreleased master to cache multiple paths
16+
id: cache
17+
with:
18+
# must be done before bootstrap to not include node_modules files in the cache paths
19+
path: |
20+
packages/*/package-lock.json
21+
benchmark/*/package-lock.json
22+
backwards-compatability/*/package-lock.json
23+
metapackages/*/package-lock.json
24+
packages/*/package-lock.json
25+
integration-tests/*/package-lock.json
26+
key: ${{ runner.os }}-docs-${{ hashFiles('**/package.json') }}
27+
28+
- name: Install root dependencies
29+
run: npm ci --ignore-scripts
30+
31+
- name: Install and Build (cache miss) πŸ”§
32+
if: steps.cache.outputs.cache-hit != 'true'
33+
run: npx lerna bootstrap --no-ci --scope @opentelemetry/api --include-dependencies
34+
35+
- name: Install and Build (cache hit) πŸ”§
36+
if: steps.cache.outputs.cache-hit == 'true'
37+
run: npx lerna bootstrap --scope @opentelemetry/api --include-dependencies
1838

1939
- name: Build πŸ”§
2040
run: |

β€Ž.github/workflows/lint.ymlβ€Ž

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,46 @@ jobs:
2828
with:
2929
args: "./**/*.md -i ./CHANGELOG.md"
3030

31-
- name: Bootstrap
31+
- name: restore lock files
32+
uses: actions/cache@master # must use unreleased master to cache multiple paths
33+
id: cache
34+
with:
35+
# must be done before bootstrap to not include node_modules files in the cache paths
36+
path: |
37+
packages/*/package-lock.json
38+
benchmark/*/package-lock.json
39+
backwards-compatability/*/package-lock.json
40+
metapackages/*/package-lock.json
41+
packages/*/package-lock.json
42+
integration-tests/*/package-lock.json
43+
key: ${{ runner.os }}-lint-${{ hashFiles('**/package.json') }}
44+
45+
- name: Install root dependencies
46+
run: npm ci --ignore-scripts
47+
48+
# On a cache hit, use ci to speed up the install process
49+
- name: Bootstrap (cache hit)
50+
if: steps.cache.outputs.cache-hit == 'true'
51+
run: npx lerna bootstrap --ignore-scripts
52+
53+
# On a cache miss, fall back to a regular install
54+
- name: Bootstrap (cache miss)
3255
if: steps.cache.outputs.cache-hit != 'true'
33-
run: |
34-
npm ci --ignore-scripts
35-
npx lerna bootstrap --ignore-scripts
56+
run: npx lerna bootstrap --no-ci --ignore-scripts -- --only=dev
3657

3758
- name: Lint
3859
run: |
3960
npm run lint
4061
npm run lint:examples
4162
42-
- name: Install API Dependencies
63+
- name: Install API Dependencies (cache hit)
64+
if: steps.cache.outputs.cache-hit == 'true'
4365
run: npx lerna bootstrap --scope @opentelemetry/api --include-dependencies
4466

67+
- name: Install API Dependencies (cache miss)
68+
if: steps.cache.outputs.cache-hit != 'true'
69+
run: npx lerna bootstrap --no-ci --scope @opentelemetry/api --include-dependencies
70+
4571
- name: Build πŸ”§
4672
run: |
4773
npx lerna run compile --scope @opentelemetry/api

β€Ž.github/workflows/unit-test.ymlβ€Ž

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,36 @@ jobs:
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v1
22-
- name: Install Root Dependencies
22+
23+
- name: restore lock files
24+
uses: actions/cache@master # must use unreleased master to cache multiple paths
25+
id: cache
26+
with:
27+
# must be done before bootstrap to not include node_modules files in the cache paths
28+
path: |
29+
packages/*/package-lock.json
30+
benchmark/*/package-lock.json
31+
backwards-compatability/*/package-lock.json
32+
metapackages/*/package-lock.json
33+
packages/*/package-lock.json
34+
integration-tests/*/package-lock.json
35+
key: ${{ runner.os }}-unit_test-${{ matrix.container }}-${{ hashFiles('**/package.json') }}
36+
37+
- name: Install root dependencies
2338
run: npm ci --ignore-scripts
24-
- name: Boostrap Dependencies
25-
run: npx lerna bootstrap
26-
- name: Build
27-
run: npm run compile
39+
40+
- name: Install and Build (cache miss) πŸ”§
41+
if: steps.cache.outputs.cache-hit != 'true'
42+
run: |
43+
npx lerna bootstrap --no-ci
44+
npm run compile
45+
46+
- name: Install and Build (cache hit) πŸ”§
47+
if: steps.cache.outputs.cache-hit == 'true'
48+
run: |
49+
npx lerna bootstrap
50+
npm run compile
51+
2852
- name: Unit tests
2953
run: npm run test
3054
- name: Report Coverage
@@ -41,12 +65,36 @@ jobs:
4165
uses: actions/checkout@v1
4266
- name: Permission Setup
4367
run: sudo chmod -R 777 /github /__w
44-
- name: Install Root Dependencies
68+
69+
- name: restore lock files
70+
uses: actions/cache@master # must use unreleased master to cache multiple paths
71+
id: cache
72+
with:
73+
# must be done before bootstrap to not include node_modules files in the cache paths
74+
path: |
75+
packages/*/package-lock.json
76+
benchmark/*/package-lock.json
77+
backwards-compatability/*/package-lock.json
78+
metapackages/*/package-lock.json
79+
packages/*/package-lock.json
80+
integration-tests/*/package-lock.json
81+
key: ${{ runner.os }}-unit_test-${{ matrix.container }}-${{ hashFiles('**/package.json') }}
82+
83+
- name: Install root dependencies
4584
run: npm ci --ignore-scripts
46-
- name: Boostrap Dependencies
47-
run: npx lerna bootstrap
48-
- name: Build
49-
run: npm run compile
85+
86+
- name: Install and Build (cache miss) πŸ”§
87+
if: steps.cache.outputs.cache-hit != 'true'
88+
run: |
89+
npx lerna bootstrap --no-ci
90+
npm run compile
91+
92+
- name: Install and Build (cache hit) πŸ”§
93+
if: steps.cache.outputs.cache-hit == 'true'
94+
run: |
95+
npx lerna bootstrap
96+
npm run compile
97+
5098
- name: Unit tests
5199
run: npm run test:browser
52100
- name: Report Coverage

β€Ž.github/workflows/w3c-integration-test.ymlβ€Ž

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run w3c tests on push
1+
name: W3C Trace Context Integration Test
22

33
on:
44
push:
@@ -7,16 +7,36 @@ on:
77
pull_request:
88

99
jobs:
10-
build-and-deploy:
10+
build-and-test:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout πŸ›ŽοΈ
1414
uses: actions/checkout@v2
1515

16-
- name: Install
17-
run: |
18-
npm ci --ignore-scripts
19-
npx lerna bootstrap --scope=propagation-validation-server --include-dependencies
16+
- name: restore lock files
17+
uses: actions/cache@master # must use unreleased master to cache multiple paths
18+
id: cache
19+
with:
20+
# must be done before bootstrap to not include node_modules files in the cache paths
21+
path: |
22+
packages/*/package-lock.json
23+
benchmark/*/package-lock.json
24+
backwards-compatability/*/package-lock.json
25+
metapackages/*/package-lock.json
26+
packages/*/package-lock.json
27+
integration-tests/*/package-lock.json
28+
key: ${{ runner.os }}-w3c_integration-${{ hashFiles('**/package.json') }}
29+
30+
- name: Install root dependencies
31+
run: npm ci --ignore-scripts
32+
33+
- name: Install and Build (cache miss) πŸ”§
34+
if: steps.cache.outputs.cache-hit != 'true'
35+
run: npx lerna bootstrap --no-ci --scope=propagation-validation-server --include-dependencies
36+
37+
- name: Install and Build (cache hit) πŸ”§
38+
if: steps.cache.outputs.cache-hit == 'true'
39+
run: npx lerna bootstrap --scope=propagation-validation-server --include-dependencies
2040

2141
- name: Build πŸ”§
2242
run: npm run compile

β€Ž.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ typings/
6161
# lock files
6262
yarn.lock
6363
packages/**/yarn.lock
64+
*/**/package-lock.json
6465

6566
# docs files
6667
docs

β€Žbackwards-compatability/node10/package-lock.jsonβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Žbackwards-compatability/node12/package-lock.jsonβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Žbackwards-compatability/node8/package-lock.jsonβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
Β (0)