From 8017989f2e301723fdad667f1680ecd79ecd2512 Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Tue, 29 Jun 2021 13:25:55 -0500 Subject: [PATCH 1/8] fix: ci github action --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++ .travis.yml | 44 ------------------------ _develop/karma.config.js | 2 +- _develop/sauce.js | 6 ++-- package.json | 2 +- 6 files changed, 123 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..408bb3005d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 + +jobs: + build: + strategy: + fail-fast: false + max-parallel: 3 + matrix: + browser: ["mac-chrome-latest","mac-firefox-latest","mac-safari-latest","windows-chrome-latest","windows-firefox-latest","windows-edge-latest","ios-latest", "android-latest"] + experimental: [false] + include: + - browser: "android-latest" + experimental: true + name: Build assets + runs-on: [ubuntu-latest] + continue-on-error: ${{ matrix.experimental }} + steps: + + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: '12.x' + always-auth: true + registry-url: 'https://npm.pkg.github.com' + scope: '@typeform' + + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install Node.js dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}} + + - name: Build + run: npm run build + + - name: Lint & Karma + env: + BROWSER: ${{ matrix.browser }} + run: npm run lint-and-karma || npm run lint-and-karma \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000..b14447bc04 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +name: Deploy + +on: + workflow_run: + workflows: ['CI'] + branches: [develop] + types: + - completed +env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + +jobs: + build: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: [ubuntu-latest] + steps: + + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: '12.x' + always-auth: true + registry-url: 'https://npm.pkg.github.com' + scope: '@typeform' + + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install Node.js dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}} + + - name: Deploy + if: contains(github.ref, 'refs/heads/develop') + run: | + npm run build + npm run semantic-release + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 92095577c3..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: node_js -node_js: - - 'lts/*' - -branches: - only: - - develop -os: - - linux -dist: xenial - -before_install: - - npm config set '//npm.pkg.github.com/:_authToken' $GH_TOKEN - - npm config set @typeform:registry https://npm.pkg.github.com/ - -install: - - npm ci - -script: - - npm run build - - travis_retry npm run travis - -env: - global: - - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 - jobs: - - BROWSER=mac-chrome-latest - - BROWSER=mac-firefox-latest - - BROWSER=mac-safari-latest - - BROWSER=windows-chrome-latest - - BROWSER=windows-firefox-latest - - BROWSER=windows-edge-latest - - BROWSER=ios-latest - # - BROWSER=android-latest - -jobs: - allow_failures: - - env: BROWSER=android-latest - include: - - stage: "Deploy" - if: (NOT type IN (pull_request)) AND (branch = develop) - script: - - npm run build - - npm run semantic-release diff --git a/_develop/karma.config.js b/_develop/karma.config.js index 5893c90994..c6955f5400 100644 --- a/_develop/karma.config.js +++ b/_develop/karma.config.js @@ -54,7 +54,7 @@ module.exports = config => { }); /* eslint-disable no-param-reassign */ - if (process.env.TRAVIS) { + if (process.env.CI) { config.transports = ['polling']; config.browsers = [process.env.BROWSER]; config.browserDisconnectTimeout = 10000; diff --git a/_develop/sauce.js b/_develop/sauce.js index f8448d5ead..0a56412ad5 100644 --- a/_develop/sauce.js +++ b/_develop/sauce.js @@ -1,10 +1,10 @@ const _ = require('lodash'); const os = require('os'); -if (process.env.TRAVIS) { +if (process.env.CI) { module.exports = { - build: process.env.TRAVIS_BUILD_ID, - tunnel: process.env.TRAVIS_JOB_NUMBER, + build: process.env.GITHUB_RUN_ID, + tunnel: process.env.GITHUB_RUN_NUMBER, }; } else { const id = _.random(16 * 16 * 16 * 16).toString(16); diff --git a/package.json b/package.json index 404f927d72..00bdffba6d 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,7 @@ "test:functional": "./_develop/scripts/puppeteer.sh", "test:unit": "npm run build; karma start _develop/karma.config.js", "test:coverage": "webpack --env.coverage --config _develop/webpack.config.js; karma start _develop/karma.config.js --reporters coverage", - "travis": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs" + "lint-and-karma": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs" }, "keywords": [ "editor", From f727caca6713e1f6429e85a48f35b207d033bbac Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Tue, 29 Jun 2021 14:49:25 -0500 Subject: [PATCH 2/8] chore: testing --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 408bb3005d..06e467ccff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - browser: ["mac-chrome-latest","mac-firefox-latest","mac-safari-latest","windows-chrome-latest","windows-firefox-latest","windows-edge-latest","ios-latest", "android-latest"] + browser: ["mac-chrome-latest","mac-firefox-latest","mac-safari-latest","windows-chrome-latest","windows-firefox-latest","windows-edge-latest","ios-latest"] experimental: [false] include: - browser: "android-latest" From edfa9197060719101a297fcda26b13dc544cc6ab Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Tue, 29 Jun 2021 15:03:26 -0500 Subject: [PATCH 3/8] chore: max-parallel 2 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06e467ccff..067319388f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: build: strategy: fail-fast: false - max-parallel: 3 + max-parallel: 2 matrix: browser: ["mac-chrome-latest","mac-firefox-latest","mac-safari-latest","windows-chrome-latest","windows-firefox-latest","windows-edge-latest","ios-latest"] experimental: [false] From fd0f638ba0809d12b066bd4ef89ff043d255d533 Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Tue, 29 Jun 2021 15:23:27 -0500 Subject: [PATCH 4/8] chore: removing failed android browser --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 067319388f..d3aaa461d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,17 +15,11 @@ env: jobs: build: strategy: - fail-fast: false max-parallel: 2 matrix: browser: ["mac-chrome-latest","mac-firefox-latest","mac-safari-latest","windows-chrome-latest","windows-firefox-latest","windows-edge-latest","ios-latest"] - experimental: [false] - include: - - browser: "android-latest" - experimental: true name: Build assets runs-on: [ubuntu-latest] - continue-on-error: ${{ matrix.experimental }} steps: - name: Cancel Previous Runs From b46e9e1ecd3498a92394ef42b36527e086db65bd Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Tue, 29 Jun 2021 15:25:37 -0500 Subject: [PATCH 5/8] chore: newlines end of files --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3aaa461d1..ded44e286d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,4 +57,4 @@ jobs: - name: Lint & Karma env: BROWSER: ${{ matrix.browser }} - run: npm run lint-and-karma || npm run lint-and-karma \ No newline at end of file + run: npm run lint-and-karma || npm run lint-and-karma diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b14447bc04..e3a917b4b6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,4 +49,3 @@ jobs: run: | npm run build npm run semantic-release - \ No newline at end of file From 33439b9621aef3c4298660a28a2e274e905d656d Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Tue, 29 Jun 2021 15:49:40 -0500 Subject: [PATCH 6/8] chore: testing --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ded44e286d..f00bbe31a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ env: jobs: build: strategy: - max-parallel: 2 + max-parallel: 1 matrix: browser: ["mac-chrome-latest","mac-firefox-latest","mac-safari-latest","windows-chrome-latest","windows-firefox-latest","windows-edge-latest","ios-latest"] name: Build assets From 37ad9cda66380d8d937b29bf47c2eac69d316106 Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Wed, 30 Jun 2021 09:50:26 -0500 Subject: [PATCH 7/8] chore: remove unnecessary env var --- .github/workflows/ci.yml | 6 ------ .github/workflows/deploy.yml | 7 ------- 2 files changed, 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f00bbe31a7..e5f4782e90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,6 @@ on: - develop env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 jobs: @@ -34,9 +33,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: '12.x' - always-auth: true - registry-url: 'https://npm.pkg.github.com' - scope: '@typeform' - name: Cache node modules uses: actions/cache@v2 @@ -48,8 +44,6 @@ jobs: - name: Install Node.js dependencies run: npm ci - env: - NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}} - name: Build run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e3a917b4b6..1b6215e5da 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,8 +6,6 @@ on: branches: [develop] types: - completed -env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} jobs: build: @@ -27,9 +25,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: '12.x' - always-auth: true - registry-url: 'https://npm.pkg.github.com' - scope: '@typeform' - name: Cache node modules uses: actions/cache@v2 @@ -41,8 +36,6 @@ jobs: - name: Install Node.js dependencies run: npm ci - env: - NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}} - name: Deploy if: contains(github.ref, 'refs/heads/develop') From b785351c172c3eb0ae162e9dc335bac498a5d865 Mon Sep 17 00:00:00 2001 From: Freddy Jimenez Date: Thu, 1 Jul 2021 08:46:59 -0500 Subject: [PATCH 8/8] chore: tf registry --- .github/workflows/deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1b6215e5da..d13699ab90 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,6 +26,11 @@ jobs: with: node-version: '12.x' + - name: Set GitHub packages registry + run: | + npm config set '//npm.pkg.github.com/:_authToken' ${{ secrets.GH_TOKEN }} + npm config set @typeform:registry https://npm.pkg.github.com/ + - name: Cache node modules uses: actions/cache@v2 with: