diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1dd7b0a3376a..b84f7b784f12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ jobs: job_build: name: Build runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 @@ -31,6 +32,7 @@ jobs: job_size_check: name: Size Check needs: job_build + timeout-minutes: 15 runs-on: ubuntu-latest if: ${{ github.head_ref }} steps: @@ -54,6 +56,7 @@ jobs: job_lint: name: Lint needs: job_build + timeout-minutes: 10 runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -70,15 +73,22 @@ jobs: key: ${{ github.sha }} - run: yarn install - name: Run Linter - run: yarn lint + run: yarn lint:ci job_unit_test: name: Test needs: job_build + continue-on-error: true + timeout-minutes: 30 runs-on: ubuntu-latest + strategy: + matrix: + node: [6, 8, 10, 12, 14] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} - uses: actions/cache@v2 with: path: | @@ -89,9 +99,10 @@ jobs: ${{ github.workspace }}/packages/**/esm ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip key: ${{ github.sha }} - - run: yarn install - name: Unit Tests - run: yarn test + env: + NODE_VERSION: ${{ matrix.node }} + run: ./scripts/test.sh - uses: codecov/codecov-action@v1 job_artifacts: @@ -129,6 +140,7 @@ jobs: name: BrowserStack needs: job_build runs-on: ubuntu-latest + timeout-minutes: 15 if: "github.ref == 'refs/heads/master'" steps: - uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cc663a685da8..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -git: - depth: false # we need this to make proper releases - -branches: - only: - - master - - /^release\/.+$/ - - /^major\/.+$/ - -install: yarn --ignore-engines --ignore-scripts -os: linux - -language: node_js -dist: bionic - -cache: - yarn: true - directories: - - node_modules - -jobs: - include: - - name: '@sentry/packages - build and test [node v6]' - node_js: '6' - script: scripts/test.sh - - name: '@sentry/packages - build and test [node v8]' - node_js: '8' - script: scripts/test.sh - - name: '@sentry/packages - build and test [node v10]' - node_js: '10' - script: scripts/test.sh - - name: '@sentry/packages - build and test [node v12]' - node_js: '12' - script: scripts/test.sh - - name: '@sentry/packages - build and test [node v14]' - node_js: '14' - script: scripts/test.sh diff --git a/package.json b/package.json index 319ca86a9e62..49428b5cde4c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "fix": "lerna run --stream --concurrency 1 fix", "link:yarn": "lerna run --stream --concurrency 1 link:yarn", "lint": "lerna run --stream --concurrency 1 lint", + "lint:ci": "lerna run --stream lint", "test": "lerna run --stream --concurrency 1 --sort test", + "test:ci": "lerna run --stream --sort test", "codecov": "codecov", "pack:changed": "lerna run pack --since", "postpublish": "make publish-docs" diff --git a/packages/browser/test/integration/browsers.js b/packages/browser/test/integration/browsers.js index 8e81160ca7a5..ee226a872545 100644 --- a/packages/browser/test/integration/browsers.js +++ b/packages/browser/test/integration/browsers.js @@ -23,7 +23,7 @@ module.exports = { bs_android_6: { base: "BrowserStack", browser: "Android Browser", - device: "Samsung Galaxy Note 4", + device: "Google Nexus 6", os: "android", os_version: "6.0", real_mobile: true, diff --git a/packages/browser/test/integration/karma.conf.js b/packages/browser/test/integration/karma.conf.js index 2f802487c3ba..cd94f5b335c7 100644 --- a/packages/browser/test/integration/karma.conf.js +++ b/packages/browser/test/integration/karma.conf.js @@ -12,8 +12,8 @@ const browsers = isLocalRun ? ["ChromeHeadless"] : Object.keys(customLaunchers); // for each browser here, so that we have a nice distinction of when the tests were run exactly. if (!isLocalRun) { for (const browser in customLaunchers) { - customLaunchers[browser].build = process.env.TRAVIS_BUILD_NUMBER - ? `Travis: ${process.env.TRAVIS_BUILD_NUMBER}` + customLaunchers[browser].build = process.env.GITHUB_RUN_ID + ? `CI: ${process.env.GITHUB_RUN_ID}` : `Manual: ${new Date().toLocaleString()}`; } } diff --git a/scripts/test.sh b/scripts/test.sh index ff98d2485259..700a9b13a56a 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,7 +3,8 @@ set -e source ~/.nvm/nvm.sh # We need this check to skip engines check for typescript-tslint-plugin package -if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -le 6 ]]; then +if [[ "$(cut -d. -f1 <<< "$NODE_VERSION")" -le 6 ]]; then + nvm install 8 nvm use 8 yarn install --ignore-engines --ignore-scripts # current versions of nock don't support node 6 @@ -12,17 +13,18 @@ if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -le 6 ]]; then cd ../.. # ember requires Node >= 10 to build yarn build --ignore="@sentry/ember" --ignore="@sentry/serverless" --ignore="@sentry/gatsby" --ignore="@sentry/react" + nvm install 6 nvm use 6 # browser can be tested only on Node >= v8 because Karma is not supporting anything older - yarn test --ignore="@sentry/tracing" --ignore="@sentry/react" --ignore="@sentry/gatsby" --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry-internal/eslint-config-sdk" --ignore="@sentry/serverless" --ignore="@sentry/browser" --ignore="@sentry/integrations" -elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -le 8 ]]; then + yarn test:ci --ignore="@sentry/tracing" --ignore="@sentry/react" --ignore="@sentry/gatsby" --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry-internal/eslint-config-sdk" --ignore="@sentry/serverless" --ignore="@sentry/browser" --ignore="@sentry/integrations" +elif [[ "$(cut -d. -f1 <<< "$NODE_VERSION")" -le 8 ]]; then yarn install --ignore-engines --ignore-scripts # ember requires Node >= 10 to build yarn build --ignore="@sentry/ember" --ignore="@sentry/serverless" --ignore="@sentry/gatsby" --ignore="@sentry/react" # serverless, tracing, ember and react work only on Node >= v10 - yarn test --ignore="@sentry/tracing" --ignore="@sentry/react" --ignore="@sentry/gatsby" --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry-internal/eslint-config-sdk" --ignore="@sentry/serverless" + yarn test:ci --ignore="@sentry/tracing" --ignore="@sentry/react" --ignore="@sentry/gatsby" --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry-internal/eslint-config-sdk" --ignore="@sentry/serverless" else yarn install yarn build - yarn test + yarn test:ci fi