Skip to content

Commit

Permalink
ci: fix browser cache hashing issues (open-telemetry#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
rauno56 authored Jan 10, 2022
1 parent 0ec9f08 commit e1e2d0e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
52 changes: 34 additions & 18 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ jobs:
RUN_MYSQL_TESTS: 1
RUN_POSTGRES_TESTS: 1
RUN_REDIS_TESTS: 1
OPENTELEMETRY_MEMCACHED_HOST: localhost
OPENTELEMETRY_MEMCACHED_PORT: 11211
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
OPENTELEMETRY_REDIS_HOST: localhost
OPENTELEMETRY_REDIS_PORT: 6379
CASSANDRA_HOST: localhost
MONGODB_DB: opentelemetry-tests
MONGODB_HOST: localhost
MONGODB_PORT: 27017
MYSQL_USER: otel
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_HOST: localhost
MYSQL_PASSWORD: secret
MYSQL_PORT: 3306
MYSQL_USER: otel
OPENTELEMETRY_MEMCACHED_HOST: localhost
OPENTELEMETRY_MEMCACHED_PORT: 11211
OPENTELEMETRY_REDIS_HOST: localhost
OPENTELEMETRY_REDIS_PORT: 6379
POSTGRES_DB: circle_database
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
NPM_CONFIG_UNSAFE_PERM: true
CASSANDRA_HOST: localhost
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -107,12 +107,18 @@ jobs:
node_modules
package-lock.json
detectors/node/*/node_modules
detectors/node/*/package-lock.json
metapackages/*/node_modules
metapackages/*/package-lock.json
packages/*/node_modules
packages/*/package-lock.json
plugins/node/*/node_modules
plugins/node/*/package-lock.json
plugins/web/*/node_modules
plugins/web/*/package-lock.json
propagators/*/node_modules
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/package.json') }}
propagators/*/package-lock.json
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package.json', 'detectors/node/*/package.json', 'metapackages/*/package.json', 'packages/*/package.json', 'plugins/node/*/package.json', 'plugins/web/*/package.json', 'propagators/*/package.json') }}
- name: Legacy Peer Dependencies for npm 7
if: matrix.node == '16'
run: npm config set legacy-peer-deps=true
Expand All @@ -125,32 +131,42 @@ jobs:
- name: Report Coverage
if: matrix.node == '14'
run: npm run codecov:ci:changed
browser-tests:

browser-test:
strategy:
fail-fast: false
matrix:
node: ["12"]
runs-on: ubuntu-latest
container:
image: circleci/node:12-browsers
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Permission Setup
run: sudo chmod -R 777 /github /__w
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: |
node_modules
package-lock.json
detectors/node/*/node_modules
detectors/node/*/package-lock.json
metapackages/*/node_modules
metapackages/*/package-lock.json
packages/*/node_modules
packages/*/package-lock.json
plugins/node/*/node_modules
plugins/node/*/package-lock.json
plugins/web/*/node_modules
plugins/web/*/package-lock.json
propagators/*/node_modules
key: ${{ runner.os }}-browser-${{ hashFiles('**/package.json') }}
propagators/*/package-lock.json
key: ${{ runner.os }}${{ matrix.node }}-browser-${{ hashFiles('package.json', 'detectors/node/*/package.json', 'metapackages/*/package.json', 'packages/*/package.json', 'plugins/node/*/package.json', 'plugins/web/*/package.json', 'propagators/*/package.json') }}
- name: Install Root Dependencies
run: npm install --ignore-scripts
- name: Bootstrap Dependencies
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"prewatch": "npm run precompile",
"test": "lerna run test",
"test:ci:changed": "lerna run test --since origin/main",
"test:browser": "lerna run test:browser",
"test:browser": "lerna run test:browser --concurrency 1",
"bootstrap": "lerna bootstrap --no-ci",
"bump": "lerna publish",
"codecov": "lerna run codecov",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@types/webpack-env": "1.16.2",
"babel-loader": "8.2.2",
"codecov": "3.8.3",
"colors": "1.4.0",
"gts": "3.1.0",
"istanbul-instrumenter-loader": "3.0.1",
"karma": "5.2.3",
Expand Down

0 comments on commit e1e2d0e

Please sign in to comment.