From 05e5c7e7eca1a34580bde649e758d4b735c7b742 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 22 Feb 2022 11:37:36 +0000 Subject: [PATCH 01/16] Node CI tests on Windows --- .github/workflows/build.yml | 88 ++++++++++++++++++++++++++++++------- scripts/test.js | 40 +++++++++++++++++ scripts/test.sh | 39 ---------------- 3 files changed, 111 insertions(+), 56 deletions(-) create mode 100644 scripts/test.js delete mode 100755 scripts/test.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c009ac08166..92084594885a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ env: jobs: job_install_deps: - name: Install Dependencies + name: Install Dependencies - Linux runs-on: ubuntu-latest timeout-minutes: 15 steps: @@ -43,7 +43,7 @@ jobs: uses: actions/cache@v2 id: cache_dependencies with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ steps.compute_lockfile_hash.outputs.hash }} - name: Install dependencies if: steps.cache_dependencies.outputs.cache-hit == '' @@ -51,9 +51,35 @@ jobs: outputs: dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }} + job_install_deps_windows: + name: Install Dependencies - Windows + runs-on: windows-latest + timeout-minutes: 15 + steps: + - name: Check out current commit (${{ github.sha }}) + uses: actions/checkout@v2 + - name: Set up Node + uses: actions/setup-node@v1 + # we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed, + # so no need to reinstall them + - name: Compute dependency cache key + id: compute_lockfile_hash + run: echo "::set-output name=hash::${{ hashFiles('yarn.lock') }}" + - name: Check dependency cache + uses: actions/cache@v2 + id: cache_dependencies + with: + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-windows + key: ${{ steps.compute_lockfile_hash.outputs.hash }} + - name: Install dependencies + if: steps.cache_dependencies.outputs.cache-hit == '' + run: yarn install --ignore-engines + outputs: + dependency_cache_key_windows: ${{ steps.compute_lockfile_hash.outputs.hash }} + job_build: name: Build - needs: job_install_deps + needs: [job_install_deps, job_install_deps_windows] runs-on: ubuntu-latest timeout-minutes: 15 steps: @@ -64,7 +90,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -91,6 +117,7 @@ jobs: # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on # `job_build` can't see `job_install_deps` and what it returned) dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} + dependency_cache_key_windows: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key_windows }} job_size_check: name: Size Check @@ -107,7 +134,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -137,7 +164,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -160,7 +187,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -171,7 +198,7 @@ jobs: run: yarn circularDepCheck job_unit_test: - name: Test (Node ${{ matrix.node }}) + name: Test (Node ${{ matrix.node }} - Linux) needs: job_build continue-on-error: true timeout-minutes: 30 @@ -189,7 +216,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -197,12 +224,39 @@ jobs: path: ${{ env.CACHED_BUILD_PATHS }} key: ${{ env.BUILD_CACHE_KEY }} - name: Run tests - env: - NODE_VERSION: ${{ matrix.node }} - run: ./scripts/test.sh + run: node ./scripts/test.js - name: Compute test coverage uses: codecov/codecov-action@v1 + job_unit_test_windows: + name: Test (Node ${{ matrix.node }} - Windows) + needs: job_build + continue-on-error: true + timeout-minutes: 30 + runs-on: windows-latest + strategy: + matrix: + node: [6, 8, 10, 12, 14, 16] + steps: + - name: Check out current commit (${{ github.sha }}) + uses: actions/checkout@v2 + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Check dependency cache + uses: actions/cache@v2 + with: + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-windows + key: ${{ needs.job_build.outputs.dependency_cache_key_windows }} + - name: Check build cache + uses: actions/cache@v2 + with: + path: ${{ env.CACHED_BUILD_PATHS }} + key: ${{ env.BUILD_CACHE_KEY }} + - name: Run tests + run: node ./scripts/test.js + # Ember tests are separate from the rest because they are the slowest part of the test suite, and making them a # separate job allows them to run in parallel with the other tests. job_ember_tests: @@ -231,7 +285,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -255,7 +309,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -289,7 +343,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -322,7 +376,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 @@ -351,7 +405,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 diff --git a/scripts/test.js b/scripts/test.js new file mode 100644 index 000000000000..b15f9336b35d --- /dev/null +++ b/scripts/test.js @@ -0,0 +1,40 @@ +const { spawnSync } = require('child_process'); +const { join } = require('path'); + +const nodeVersion = parseInt(process.version.split('.')[0].replace('v', ''), 10); + +function run(cmd) { + const result = spawnSync(cmd, { shell: true, stdio: 'inherit', cwd: join(__dirname, '..') }); + + if (result.status !== 0) { + process.exit(result.status); + } +} + +// control which packages we test on each version of node +if (nodeVersion <= 6) { + // install legacy versions of packages whose current versions don't support node 6 + // ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing + run('cd packages/node && yarn add --dev --ignore-engines --ignore-scripts nock@10.x'); + run('cd packages/tracing && yarn add --dev --ignore-engines --ignore-scripts jsdom@11.x'); + run('cd packages/utils && yarn add --dev --ignore-engines --ignore-scripts jsdom@11.x'); + + // only test against @sentry/node and its dependencies - node 6 is too old for anything else to work + run( + 'yarn test --scope="@sentry/core" --scope="@sentry/hub" --scope="@sentry/minimal" --scope="@sentry/node" --scope="@sentry/utils" --scope="@sentry/tracing"' + ); +} else if (nodeVersion <= 8) { + // install legacy versions of packages whose current versions don't support node 8 + // ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing + run('cd packages/tracing && yarn add --dev --ignore-engines --ignore-scripts jsdom@15.x'); + run('cd packages/utils && yarn add --dev --ignore-engines --ignore-scripts jsdom@15.x'); + + // ember tests happen separately, and the rest fail on node 8 for various syntax or dependency reasons + run( + 'yarn test --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry/react" --ignore="@sentry/wasm" --ignore="@sentry/gatsby" --ignore="@sentry/serverless" --ignore="@sentry/nextjs"' + ); +} else { + run('yarn test --ignore="@sentry/ember"'); +} + +process.exit(0); diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index 82ef3f3ac4fd..000000000000 --- a/scripts/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -# control which packages we test on each version of node -if [[ "$(cut -d. -f1 <<<"$NODE_VERSION")" -le 6 ]]; then - - # install legacy versions of packages whose current versions don't support node 6 - # ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing - cd packages/node - yarn add --dev --ignore-engines --ignore-scripts nock@10.x - cd ../.. - cd packages/tracing - yarn add --dev --ignore-engines --ignore-scripts jsdom@11.x - cd ../.. - cd packages/utils - yarn add --dev --ignore-engines --ignore-scripts jsdom@11.x - cd ../.. - - # only test against @sentry/node and its dependencies - node 6 is too old for anything else to work - yarn test --scope="@sentry/core" --scope="@sentry/hub" --scope="@sentry/minimal" --scope="@sentry/node" --scope="@sentry/utils" --scope="@sentry/tracing" - -elif [[ "$(cut -d. -f1 <<<"$NODE_VERSION")" -le 8 ]]; then - - # install legacy versions of packages whose current versions don't support node 8 - # ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing - cd packages/tracing - yarn add --dev --ignore-engines --ignore-scripts jsdom@15.x - cd ../.. - cd packages/utils - yarn add --dev --ignore-engines --ignore-scripts jsdom@15.x - cd ../.. - - # ember tests happen separately, and the rest fail on node 8 for various syntax or dependency reasons - yarn test --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry/react" --ignore="@sentry/wasm" --ignore="@sentry/gatsby" --ignore="@sentry/serverless" --ignore="@sentry/nextjs" - -else - yarn test --ignore="@sentry/ember" - -fi From 1db97dfcdb879e8a4a461e0c0f498c327701f9bf Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 11:59:28 +0000 Subject: [PATCH 02/16] Fix cache keys --- .github/workflows/build.yml | 53 +++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92084594885a..d7287fe39a3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,8 +43,8 @@ jobs: uses: actions/cache@v2 id: cache_dependencies with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ steps.compute_lockfile_hash.outputs.hash }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ steps.compute_lockfile_hash.outputs.hash }}-linux - name: Install dependencies if: steps.cache_dependencies.outputs.cache-hit == '' run: yarn install --ignore-engines @@ -69,13 +69,11 @@ jobs: uses: actions/cache@v2 id: cache_dependencies with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-windows - key: ${{ steps.compute_lockfile_hash.outputs.hash }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ steps.compute_lockfile_hash.outputs.hash }}-windows - name: Install dependencies if: steps.cache_dependencies.outputs.cache-hit == '' run: yarn install --ignore-engines - outputs: - dependency_cache_key_windows: ${{ steps.compute_lockfile_hash.outputs.hash }} job_build: name: Build @@ -90,8 +88,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 id: cache_built_packages @@ -117,7 +115,6 @@ jobs: # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on # `job_build` can't see `job_install_deps` and what it returned) dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - dependency_cache_key_windows: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key_windows }} job_size_check: name: Size Check @@ -134,8 +131,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -164,8 +161,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -187,8 +184,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -216,8 +213,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -247,8 +244,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-windows - key: ${{ needs.job_build.outputs.dependency_cache_key_windows }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key_windows }}-windows - name: Check build cache uses: actions/cache@v2 with: @@ -285,8 +282,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -309,8 +306,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -343,8 +340,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -376,8 +373,8 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux - key: ${{ needs.job_build.outputs.dependency_cache_key }} + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux - name: Check build cache uses: actions/cache@v2 with: @@ -405,7 +402,7 @@ jobs: - name: Check dependency cache uses: actions/cache@v2 with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }}-linux + path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 From aea06cbbe8b30bb5b8d04b21a62e538e27d49058 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 12:23:52 +0000 Subject: [PATCH 03/16] Fix windows key --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7287fe39a3d..0e49d7094234 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -245,7 +245,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key_windows }}-windows + key: ${{ needs.job_build.outputs.dependency_cache_key }}-windows - name: Check build cache uses: actions/cache@v2 with: From 4b54dc93d879f90ec874e55d01cd8d0f840fc506 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 12:38:36 +0000 Subject: [PATCH 04/16] Another approach --- .github/workflows/build.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e49d7094234..54ab1fbe5efe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: if: steps.cache_dependencies.outputs.cache-hit == '' run: yarn install --ignore-engines outputs: - dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }} + dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}-linux job_install_deps_windows: name: Install Dependencies - Windows @@ -74,6 +74,8 @@ jobs: - name: Install dependencies if: steps.cache_dependencies.outputs.cache-hit == '' run: yarn install --ignore-engines + outputs: + dependency_cache_key_windows: ${{ steps.compute_lockfile_hash.outputs.hash }}-windows job_build: name: Build @@ -115,6 +117,7 @@ jobs: # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on # `job_build` can't see `job_install_deps` and what it returned) dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} + dependency_cache_key_windows: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key_windows }} job_size_check: name: Size Check @@ -132,7 +135,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -162,7 +165,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -185,7 +188,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -214,7 +217,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -245,7 +248,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-windows + key: ${{ needs.job_build.outputs.dependency_cache_key_windows }} - name: Check build cache uses: actions/cache@v2 with: @@ -283,7 +286,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -307,7 +310,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -341,7 +344,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -374,7 +377,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_build.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: From caa2c5313c5bbee1efc15a324d3afb9ef2b30f7a Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 12:42:34 +0000 Subject: [PATCH 05/16] CI whack-a-mole is labourious --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54ab1fbe5efe..163c402c854f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,7 +91,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}-linux + key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 id: cache_built_packages From ec596d472383f4376c16ea5c05f1b2ff5a4a3b95 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 14:39:30 +0000 Subject: [PATCH 06/16] Only run @sentry/node tests on windows for now --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 163c402c854f..79e05ddb938c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -230,7 +230,7 @@ jobs: job_unit_test_windows: name: Test (Node ${{ matrix.node }} - Windows) - needs: job_build + needs: job_install_deps_windows continue-on-error: true timeout-minutes: 30 runs-on: windows-latest @@ -249,13 +249,8 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key_windows }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - name: Run tests - run: node ./scripts/test.js + run: cd packages/node && yarn test # Ember tests are separate from the rest because they are the slowest part of the test suite, and making them a # separate job allows them to run in parallel with the other tests. From 5871b12190f192021bdcae12cdf7b32ee9d96169 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 14:45:38 +0000 Subject: [PATCH 07/16] Correct cache keys --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79e05ddb938c..b3aea243da78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,11 +75,11 @@ jobs: if: steps.cache_dependencies.outputs.cache-hit == '' run: yarn install --ignore-engines outputs: - dependency_cache_key_windows: ${{ steps.compute_lockfile_hash.outputs.hash }}-windows + dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}-windows job_build: name: Build - needs: [job_install_deps, job_install_deps_windows] + needs: job_install_deps runs-on: ubuntu-latest timeout-minutes: 15 steps: @@ -117,7 +117,6 @@ jobs: # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on # `job_build` can't see `job_install_deps` and what it returned) dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - dependency_cache_key_windows: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key_windows }} job_size_check: name: Size Check @@ -248,7 +247,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key_windows }} + key: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key }} - name: Run tests run: cd packages/node && yarn test From 107ef3de10b140520ea27c88144cc0657e2092bc Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 24 Feb 2022 22:22:29 +0000 Subject: [PATCH 08/16] Combine windows/linux tests --- .github/workflows/build.yml | 39 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3aea243da78..b59fbd74a1b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,13 +197,14 @@ jobs: run: yarn circularDepCheck job_unit_test: - name: Test (Node ${{ matrix.node }} - Linux) - needs: job_build + name: Test (Node ${{ matrix.node }} - ${{ matrix.os }}) + needs: [job_build, job_install_deps_windows] continue-on-error: true timeout-minutes: 30 - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest] node: [6, 8, 10, 12, 14, 16] steps: - name: Check out current commit (${{ github.sha }}) @@ -213,10 +214,17 @@ jobs: with: node-version: ${{ matrix.node }} - name: Check dependency cache + if: matrix.os == 'ubuntu-latest' uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} + - name: Check dependency cache + if: matrix.os == 'windows-latest' + uses: actions/cache@v2 + with: + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -225,32 +233,9 @@ jobs: - name: Run tests run: node ./scripts/test.js - name: Compute test coverage + if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v1 - job_unit_test_windows: - name: Test (Node ${{ matrix.node }} - Windows) - needs: job_install_deps_windows - continue-on-error: true - timeout-minutes: 30 - runs-on: windows-latest - strategy: - matrix: - node: [6, 8, 10, 12, 14, 16] - steps: - - name: Check out current commit (${{ github.sha }}) - uses: actions/checkout@v2 - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key }} - - name: Run tests - run: cd packages/node && yarn test - # Ember tests are separate from the rest because they are the slowest part of the test suite, and making them a # separate job allows them to run in parallel with the other tests. job_ember_tests: From 89903e12ec34b344dc543178615bf9c7bfffffbf Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 25 Feb 2022 01:17:58 +0000 Subject: [PATCH 09/16] Fix windows --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b59fbd74a1b7..94e83764d182 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ env: ${{ github.workspace }}/packages/ember/instance-initializers ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip - BUILD_CACHE_KEY: ${{ github.sha }} + BUILD_CACHE_KEY: build-${{ github.sha }} jobs: job_install_deps: @@ -230,6 +230,9 @@ jobs: with: path: ${{ env.CACHED_BUILD_PATHS }} key: ${{ env.BUILD_CACHE_KEY }} + restore-keys: | + build- + - name: Run tests run: node ./scripts/test.js - name: Compute test coverage From 7c22b6c939db8afc7b788090730228254b909295 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 17:57:32 +0000 Subject: [PATCH 10/16] Maybe build cache does not work between platforms? --- .github/workflows/build.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c1343d77057..cf3a85234d6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,6 +118,34 @@ jobs: # `job_build` can't see `job_install_deps` and what it returned) dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} + job_build_windows: + name: Build Windows + needs: job_install_deps_windows + runs-on: windows-latest + timeout-minutes: 15 + steps: + - name: Check out current commit (${{ github.sha }}) + uses: actions/checkout@v2 + - name: Set up Node + uses: actions/setup-node@v1 + - name: Check dependency cache + uses: actions/cache@v2 + with: + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key }} + - name: Check build cache + uses: actions/cache@v2 + id: cache_built_packages + with: + path: ${{ env.CACHED_BUILD_PATHS }} + key: ${{ env.BUILD_CACHE_KEY }} + - name: Build packages + run: yarn build + outputs: + # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on + # `job_build` can't see `job_install_deps` and what it returned) + dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} + job_size_check: name: Size Check needs: job_build @@ -198,7 +226,7 @@ jobs: job_unit_test: name: Test (Node ${{ matrix.node }} - ${{ matrix.os }}) - needs: [job_build, job_install_deps_windows] + needs: [job_build, job_build_windows] continue-on-error: true timeout-minutes: 30 runs-on: ${{ matrix.os }} @@ -224,7 +252,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key }} + key: ${{ needs.job_build_windows.outputs.dependency_cache_key }} - name: Check build cache uses: actions/cache@v2 with: @@ -232,7 +260,6 @@ jobs: key: ${{ env.BUILD_CACHE_KEY }} restore-keys: | build- - - name: Run tests run: node ./scripts/test.js - name: Compute test coverage From c207b120c377353e932ac702e163d66beaa93b83 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 18:06:47 +0000 Subject: [PATCH 11/16] no way --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf3a85234d6f..c513092be3fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,7 +140,7 @@ jobs: path: ${{ env.CACHED_BUILD_PATHS }} key: ${{ env.BUILD_CACHE_KEY }} - name: Build packages - run: yarn build + run: yarn && yarn build outputs: # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on # `job_build` can't see `job_install_deps` and what it returned) From bf9a4ee71247de31ca96d2051141a15b9cfe9958 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 18:31:55 +0000 Subject: [PATCH 12/16] build artifacts rather than cache? --- .github/workflows/build.yml | 164 +++++++++++------------------------- 1 file changed, 51 insertions(+), 113 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c513092be3fd..23d8527bb9d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,32 +51,6 @@ jobs: outputs: dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}-linux - job_install_deps_windows: - name: Install Dependencies - Windows - runs-on: windows-latest - timeout-minutes: 15 - steps: - - name: Check out current commit (${{ github.sha }}) - uses: actions/checkout@v2 - - name: Set up Node - uses: actions/setup-node@v1 - # we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed, - # so no need to reinstall them - - name: Compute dependency cache key - id: compute_lockfile_hash - run: echo "::set-output name=hash::${{ hashFiles('yarn.lock') }}" - - name: Check dependency cache - uses: actions/cache@v2 - id: cache_dependencies - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ steps.compute_lockfile_hash.outputs.hash }}-windows - - name: Install dependencies - if: steps.cache_dependencies.outputs.cache-hit == '' - run: yarn install --ignore-engines - outputs: - dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}-windows - job_build: name: Build needs: job_install_deps @@ -92,18 +66,11 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - id: cache_built_packages + - uses: actions/upload-artifact@v2 with: + name: build-output path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - name: Build packages - # Under normal circumstances, using the git SHA as a cache key, there shouldn't ever be a cache hit on the built - # packages, and so `yarn build` should always run. This `if` check is therefore only there for testing CI issues - # where the built packages are beside the point. In that case, you can change `BUILD_CACHE_KEY` (at the top of - # this file) to a constant and skip rebuilding all of the packages each time CI runs. - if: steps.cache_built_packages.outputs.cache-hit == '' run: yarn build # We are performing a `prepublishOnly` step manually because build workflow is not responsible for publishing # the actual release. It only creates artifacts which then are uploaded and used by another workflow. @@ -118,34 +85,6 @@ jobs: # `job_build` can't see `job_install_deps` and what it returned) dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - job_build_windows: - name: Build Windows - needs: job_install_deps_windows - runs-on: windows-latest - timeout-minutes: 15 - steps: - - name: Check out current commit (${{ github.sha }}) - uses: actions/checkout@v2 - - name: Set up Node - uses: actions/setup-node@v1 - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_install_deps_windows.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - id: cache_built_packages - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Build packages - run: yarn && yarn build - outputs: - # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on - # `job_build` can't see `job_install_deps` and what it returned) - dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - job_size_check: name: Size Check needs: job_build @@ -163,11 +102,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Check bundle sizes uses: getsentry/size-limit-action@v3 # Only run size check on master or pull requests @@ -193,11 +130,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run linter run: yarn lint @@ -216,23 +151,20 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run madge run: yarn circularDepCheck job_unit_test: - name: Test (Node ${{ matrix.node }} - ${{ matrix.os }}) - needs: [job_build, job_build_windows] + name: Test (Node ${{ matrix.node }} - Linux + needs: job_build continue-on-error: true timeout-minutes: 30 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: [ubuntu-latest, windows-latest] node: [6, 8, 10, 12, 14, 16] steps: - name: Check out current commit (${{ github.sha }}) @@ -242,29 +174,47 @@ jobs: with: node-version: ${{ matrix.node }} - name: Check dependency cache - if: matrix.os == 'ubuntu-latest' uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} + - uses: actions/download-artifact@v2 + with: + name: build-output + - name: Run tests + run: node ./scripts/test.js + - name: Compute test coverage + uses: codecov/codecov-action@v1 + + job_unit_test_windows: + name: Test (Node ${{ matrix.node }} - Windows + needs: job_build + continue-on-error: true + timeout-minutes: 30 + runs-on: windows-latest + strategy: + matrix: + node: [6, 8, 10, 12, 14, 16] + steps: + - name: Check out current commit (${{ github.sha }}) + uses: actions/checkout@v2 + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} - name: Check dependency cache if: matrix.os == 'windows-latest' uses: actions/cache@v2 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build_windows.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - restore-keys: | - build- + name: build-output + - name: Install dependencies + run: yarn install --ignore-engines --force - name: Run tests run: node ./scripts/test.js - - name: Compute test coverage - if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v1 job_nextjs_integration_test: name: Test @sentry/nextjs on (Node ${{ matrix.node }}) @@ -287,11 +237,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run tests env: NODE_VERSION: ${{ matrix.node }} @@ -329,11 +277,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run Ember tests run: yarn test --scope=@sentry/ember - name: Compute test coverage @@ -353,11 +299,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Pack run: yarn pack:changed - name: Archive artifacts @@ -404,11 +348,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run Playwright tests env: PW_BUNDLE: ${{ matrix.bundle }} @@ -440,11 +382,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run integration tests env: KARMA_BROWSER: ${{ matrix.browser }} @@ -469,11 +409,9 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Run build tests run: | cd packages/browser From 56e4e44fb0b993964dd52c317571b6044a985328 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 18:46:40 +0000 Subject: [PATCH 13/16] upload artifacts after build... --- .github/workflows/build.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23d8527bb9d5..7e0440f150ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,11 +22,9 @@ env: ${{ github.workspace }}/packages/ember/instance-initializers ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip - BUILD_CACHE_KEY: build-${{ github.sha }} - jobs: job_install_deps: - name: Install Dependencies - Linux + name: Install Dependencies runs-on: ubuntu-latest timeout-minutes: 15 steps: @@ -66,10 +64,6 @@ jobs: with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - - uses: actions/upload-artifact@v2 - with: - name: build-output - path: ${{ env.CACHED_BUILD_PATHS }} - name: Build packages run: yarn build # We are performing a `prepublishOnly` step manually because build workflow is not responsible for publishing @@ -77,6 +71,10 @@ jobs: # Because of that, any `prepublishOnly` script is skipped and files it produces are not included in the tarball. # We also cannot use `prepare` script which would be more suited, because it's run only before `pack` is called, # and it's done from a `release` workflow and not here. + - uses: actions/upload-artifact@v2 + with: + name: build-output + path: ${{ env.CACHED_BUILD_PATHS }} - name: Run prepublishOnly script if: startsWith(github.ref, 'refs/heads/release/') run: yarn prepublishOnly From 487e26c3f9e880a4da4c247e753f03510431ed91 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 19:04:09 +0000 Subject: [PATCH 14/16] Fixup --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e0440f150ab..3c1ec4261d89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ env: ${{ github.workspace }}/packages/ember/*.d.ts ${{ github.workspace }}/packages/ember/instance-initializers ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip + !**/node_modules/** jobs: job_install_deps: @@ -103,6 +104,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Check bundle sizes uses: getsentry/size-limit-action@v3 # Only run size check on master or pull requests @@ -131,6 +133,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run linter run: yarn lint @@ -152,6 +155,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run madge run: yarn circularDepCheck @@ -179,6 +183,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run tests run: node ./scripts/test.js - name: Compute test coverage @@ -209,6 +214,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Install dependencies run: yarn install --ignore-engines --force - name: Run tests @@ -238,6 +244,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run tests env: NODE_VERSION: ${{ matrix.node }} @@ -278,6 +285,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run Ember tests run: yarn test --scope=@sentry/ember - name: Compute test coverage @@ -300,6 +308,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Pack run: yarn pack:changed - name: Archive artifacts @@ -349,6 +358,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run Playwright tests env: PW_BUNDLE: ${{ matrix.bundle }} @@ -383,6 +393,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run integration tests env: KARMA_BROWSER: ${{ matrix.browser }} @@ -410,6 +421,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: build-output + path: ${{ github.workspace }}/packages - name: Run build tests run: | cd packages/browser From 29039228a6f2ff18cd2b5888b671ed12bbd5b817 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 19:30:16 +0000 Subject: [PATCH 15/16] Dont run nextjs tests on Windows --- scripts/test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/test.js b/scripts/test.js index b15f9336b35d..14d230156f5b 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -34,7 +34,11 @@ if (nodeVersion <= 6) { 'yarn test --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry/react" --ignore="@sentry/wasm" --ignore="@sentry/gatsby" --ignore="@sentry/serverless" --ignore="@sentry/nextjs"' ); } else { - run('yarn test --ignore="@sentry/ember"'); + if (process.platform === 'win32') { + run('yarn test --ignore="@sentry/ember" --ignore="@sentry/nextjs"'); + } else { + run('yarn test --ignore="@sentry/ember"'); + } } process.exit(0); From 218666334b4f40340c35f30b39b78f48ff3c234c Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 1 Mar 2022 20:31:48 +0000 Subject: [PATCH 16/16] minor things --- .github/workflows/build.yml | 2 +- scripts/test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c1ec4261d89..6753cc38941f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -216,7 +216,7 @@ jobs: name: build-output path: ${{ github.workspace }}/packages - name: Install dependencies - run: yarn install --ignore-engines --force + run: yarn install - name: Run tests run: node ./scripts/test.js diff --git a/scripts/test.js b/scripts/test.js index 14d230156f5b..b2ae23995161 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -4,6 +4,7 @@ const { join } = require('path'); const nodeVersion = parseInt(process.version.split('.')[0].replace('v', ''), 10); function run(cmd) { + console.log(cmd); const result = spawnSync(cmd, { shell: true, stdio: 'inherit', cwd: join(__dirname, '..') }); if (result.status !== 0) {