From 4f9114031ca6236ef45f04b67dcba1a9981035c4 Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Fri, 25 Dec 2020 14:24:44 -0500 Subject: [PATCH] feat(ci): replace CircleCI with GitHub Actions (#211) * feat(ci): replace CircleCI with GitHub Actions --- .circleci/config.yml | 39 ---------- .github/workflows/main.yml | 78 +++++++++++++++++++ README.md | 2 +- package.json | 1 + packages/common/README.md | 2 +- packages/composite-editor-component/README.md | 2 +- packages/empty-warning-component/README.md | 2 +- packages/excel-export/README.md | 2 +- packages/graphql/README.md | 2 +- packages/odata/README.md | 2 +- packages/text-export/README.md | 2 +- packages/vanilla-bundle/README.md | 2 +- test/cypress.json | 1 + 13 files changed, 89 insertions(+), 48 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/main.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index fc3316864..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: 2 -experimental: - pipelines: true -jobs: - build: - working_directory: ~/slickgrid-universal - docker: - - image: circleci/node:12-browsers - steps: - - checkout - - restore_cache: - key: slickgrid-universal-build-{{ .Branch }}-{{ checksum "yarn.lock" }} - - run: yarn install - - save_cache: - key: slickgrid-universal-build-{{ .Branch }}-{{ checksum "yarn.lock" }} - paths: - - "node_modules" - - run: - name: Build Full Bundle (all Bundler types) - command: yarn run bundle - - run: - name: Run Jest tests with JUnit as reporter - command: ./node_modules/.bin/jest --config test/jest.config.js --ci --runInBand --collectCoverage=true --reporters=jest-junit - environment: - JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" - - run: - name: Upload Jest coverage to Codecov - command: bash <(curl -s https://codecov.io/bash) - - run: - name: Website Prod Build (GitHub demo site) - command: yarn run build:demo - - run: - name: Run Web Server - command: yarn run serve:demo - background: true - - run: - name: Running Cypress E2E tests with JUnit XML reporter - command: | - yarn run cypress:ci diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..7f3a984ae --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,78 @@ +name: GitHub Actions +on: + # Trigger the workflow on push or pull request, + # but only for the master branch on Push and any branches on PR + push: + branches: + - master + pull_request: + branches: + - '**' +env: + CI: true + PREFERRED_WORKSPACE_MANAGER: yarn + +jobs: + run: + name: Node ${{ matrix.node }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node: [14] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + with: + fetch-depth: 3 + + - uses: actions/cache@v2 + with: + path: ~/.cache/yarn + key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Set Node.js version + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - run: node --version + - run: npm --version + + - name: Install npm/yarn dependencies + run: yarn install + + - name: Build Full Bundle (all Bundler types) + run: yarn run bundle + + - name: Run Jest unit tests + run: yarn test:ci + + - name: Upload Jest coverage to Codecov + run: bash <(curl -s https://codecov.io/bash) + + - name: Website Prod Build (GitHub demo site) + run: yarn run build:demo + + - name: Run Cypress E2E tests + uses: cypress-io/github-action@v2 + with: + start: yarn run serve:demo + wait-on: 'http://localhost:8888' + config-file: test/cypress.json + browser: chrome + # record: true + env: + # pass the Dashboard record key as an environment variable + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # pass GitHub token to allow accurately detecting a build vs a re-run build + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: cypress-screenshots + path: cypress/screenshots diff --git a/README.md b/README.md index abf05774a..53e1ce7d5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) [![NPM downloads](https://img.shields.io/npm/dy/@slickgrid-universal/common.svg)](https://www.npmjs.com/package/@slickgrid-universal/common) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/package.json b/package.json index 42216e8c9..01da677eb 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "serve:demo": "http-server ./docs -p 8888 -a localhost", "lint": "eslint packages/** --ext .ts", "test": "npx jest --runInBand --coverage=true --config ./test/jest.config.js", + "test:ci": "npx jest --runInBand --coverage=true --ci --config ./test/jest.config.js", "test:watch": "npx jest --watch --config ./test/jest.config.js" }, "comments": { diff --git a/packages/common/README.md b/packages/common/README.md index 7830b29dc..4286d9469 100644 --- a/packages/common/README.md +++ b/packages/common/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/common.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/common) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/common?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/common) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/composite-editor-component/README.md b/packages/composite-editor-component/README.md index a1dc06e0c..bccab42fd 100644 --- a/packages/composite-editor-component/README.md +++ b/packages/composite-editor-component/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/composite-editor-component.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/composite-editor-component) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/composite-editor-component?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/composite-editor-component) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/empty-warning-component/README.md b/packages/empty-warning-component/README.md index 26ce0e6bd..cef61d6bf 100644 --- a/packages/empty-warning-component/README.md +++ b/packages/empty-warning-component/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/empty-warning-component.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/empty-warning-component) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/empty-warning-component?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/empty-warning-component) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/excel-export/README.md b/packages/excel-export/README.md index a84342da0..a37bb9f67 100644 --- a/packages/excel-export/README.md +++ b/packages/excel-export/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/excel-export.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/excel-export) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/excel-export?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/excel-export) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/graphql/README.md b/packages/graphql/README.md index 384c5c99d..96339c5c2 100644 --- a/packages/graphql/README.md +++ b/packages/graphql/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/graphql.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/graphql) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/graphql?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/graphql) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/odata/README.md b/packages/odata/README.md index bbe679d33..79d5f1ed3 100644 --- a/packages/odata/README.md +++ b/packages/odata/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/odata.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/odata) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/odata?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/odata) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/text-export/README.md b/packages/text-export/README.md index cafa74e6a..6a8b1fc52 100644 --- a/packages/text-export/README.md +++ b/packages/text-export/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/text-export.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/text-export) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/text-export?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/text-export) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/packages/vanilla-bundle/README.md b/packages/vanilla-bundle/README.md index 904e7e44b..4130e45a1 100644 --- a/packages/vanilla-bundle/README.md +++ b/packages/vanilla-bundle/README.md @@ -4,7 +4,7 @@ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/vanilla-bundle.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/vanilla-bundle) [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/vanilla-bundle?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/vanilla-bundle) -[![CircleCI](https://circleci.com/gh/ghiscoding/slickgrid-universal/tree/master.svg?style=shield)](https://circleci.com/gh/ghiscoding/workflows/slickgrid-universal/tree/master) +[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/GitHub%20Actions/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) diff --git a/test/cypress.json b/test/cypress.json index 42ab0739c..a42d6ed5b 100644 --- a/test/cypress.json +++ b/test/cypress.json @@ -2,6 +2,7 @@ "baseUrl": "http://localhost:8888", "baseExampleUrl": "http://localhost:8888/#", "video": false, + "projectId": "p5zxx6", "viewportWidth": 1000, "viewportHeight": 950, "reporter": "mochawesome",