diff --git a/.dockerignore b/.dockerignore index fcb58c5a3b..b1e12c6d48 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,11 +2,11 @@ **/dist **/www +.git .nx .dockerignore Dockerfile -.travis.yml -travis +.github .yarn/cache .yarn/install-state.gz diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..e17376c997 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,93 @@ +name: CI +on: [push] + +jobs: + CI: + name: lint, build, test, deploy + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + name: Log in to GitHub Container Registry + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/github-script@v7 + with: + script: | + if (context.eventName === 'push') { + const [branch, type] = context.ref.split('/').reverse(); + + if (type === 'heads' && branch.lastIndexOf('#') === 0) { + core.exportVariable('DT_REF', branch.replace(/#/, '_')); + } + else if (type === 'heads' && branch === 'master') { + core.exportVariable('DT_REF', 'master'); + } + else if (type === 'tags' && branch[0] === 'v') { + core.exportVariable('DT_REF', branch.substring(1)); + core.exportVariable('DT_DIST_TAG', 'latest'); + } + } + - name: Output DT_REF + run: echo $DT_REF; + - uses: docker/build-push-action@v5 + name: Build and push Docker image + with: + push: true + tags: ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} + context: . + cache-from: | + ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} + cache-to: type=inline + build-args: | + CI + DT_REF + - name: "Prepare Cypress Parallel weights file" + run: mkdir --verbose --parents ${{ github.workspace }}/storybook/cypress-parallel + - name: "Cache: Cypress Parallel weights file" + id: cypress-parallel-weights-file-cache + uses: actions/cache@v4 + with: + key: weights-file + path: ${{ github.workspace }}/storybook/cypress-parallel/parallel-weights.json + - name: e2e tests + uses: addnab/docker-run-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + image: ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} + options: --env CI + --env DT_REF + --volume ${{ github.workspace }}/storybook/cypress-parallel:/usr/src/app/storybook/cypress-parallel + run: yarn e2e + - uses: addnab/docker-run-action@v3 + name: Deploy + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + image: ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} + options: --env CI + --env DT_REF + --env DT_DIST_TAG + --env DT_PRIVATE_KEY_BASE64 + --env DT_DEPLOY_HOST + --env DT_DEPLOY_PORT + --env DT_DEPLOY_USER + --env DT_DEPLOY_ROOT + --env DT_DEPLOY_NPM_TOKEN + --env GITHUB_TOKEN + run: bash deploy.sh + env: + DT_PRIVATE_KEY_BASE64: ${{ secrets.DT_PRIVATE_KEY_BASE64 }} + DT_DEPLOY_HOST: ${{ secrets.DT_DEPLOY_HOST }} + DT_DEPLOY_PORT: ${{ secrets.DT_DEPLOY_PORT }} + DT_DEPLOY_USER: ${{ secrets.DT_DEPLOY_USER }} + DT_DEPLOY_ROOT: ${{ secrets.DT_DEPLOY_ROOT }} + DT_DEPLOY_NPM_TOKEN: ${{ secrets.DT_DEPLOY_NPM_TOKEN }} diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 0000000000..99a5e6e00e --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,16 @@ +name: Danger +on: [pull_request] +jobs: + Danger: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Danger + run: | + npm install --global typescript danger + danger ci --failOnErrors + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cea45e88b6..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -os: linux -dist: jammy -git: - depth: false -stages: - - name: prepare - if: branch =~ /^#/ || branch = master || tag =~ /^v/ - - name: pull request check - if: type = pull_request && (branch =~ /^#/ || branch = master || tag =~ /^v/) - - name: ci/cd - if: type = push && (branch =~ /^#/ || branch = master || tag =~ /^v/) -jobs: - include: - - name: create build environment - stage: prepare - script: bash travis/create-build-environment.sh - - name: danger ci - stage: pull request check - script: bash travis/pull-request-check.sh - - name: dedupe check, npm audit, lint, build, build-www, e2e, deploy - stage: ci/cd - script: bash travis/cicd.sh - cache: - directories: - - ./storybook/cypress-parallel diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c20368a69..e1a04f56ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## Next +### Tasks +* Build: GitHub Actions pipeline ([#2568](https://github.com/dso-toolkit/dso-toolkit/issues/2568)) + ## 🦩 62.15.0 - 12-03-2024 ### Added diff --git a/Dockerfile b/Dockerfile index f82f96ea18..3dcab732bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,8 +55,7 @@ RUN yarn dedupe --check RUN (yarn npm audit --all --recursive || true) RUN yarn lint -ARG TRAVIS_BRANCH -ARG TRAVIS_TAG +ARG DT_REF RUN yarn build diff --git a/README.md b/README.md index 9f87f386e3..9b326f2896 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/dso-toolkit/dso-toolkit) [![npm version](http://img.shields.io/npm/v/dso-toolkit.svg)](https://npmjs.org/package/dso-toolkit "View this project on npm") [![Build status master branch](https://img.shields.io/travis/com/dso-toolkit/dso-toolkit/master)](https://travis-ci.com/dso-toolkit/dso-toolkit) +[![npm version](http://img.shields.io/npm/v/dso-toolkit.svg)](https://npmjs.org/package/dso-toolkit "View this project on npm") ![master branch build status](https://github.com/tfrijsewijk/dso-toolkit/actions/workflows/ci.yml/badge.svg?branch=master) - [Slack chat](https://dso-toolkit.slack.com/) - [Slack chat invite link](https://join.slack.com/t/dso-toolkit/shared_invite/zt-58125gbo-FtPAARcnU47rMgkT7KWikA) diff --git a/deploy.sh b/deploy.sh index d2332929ab..d6b82e78f9 100644 --- a/deploy.sh +++ b/deploy.sh @@ -7,39 +7,39 @@ mkdir --parents ~/.ssh cat known_hosts >> ~/.ssh/known_hosts echo -e "Host ${DT_DEPLOY_HOST}\n\tCheckHostIP no\n" >> ~/.ssh/config -rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./storybook/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/storybook.dso-toolkit.nl/www/${TRAVIS_BRANCH/\#/_} -rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./packages/react/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/react.dso-toolkit.nl/www/${TRAVIS_BRANCH/\#/_} -rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./angular-workspace/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/angular.dso-toolkit.nl/www/${TRAVIS_BRANCH/\#/_} -rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./website/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/dso-toolkit.nl/www/${TRAVIS_BRANCH/\#/_} -rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/dso-toolkit/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/dso-toolkit/${TRAVIS_BRANCH/\#/_} -rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/core/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/@dso-toolkit/core/${TRAVIS_BRANCH/\#/_} - -if [ -n "$TRAVIS_TAG" ] +rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./storybook/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/storybook.dso-toolkit.nl/www/${DT_REF} +rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./packages/react/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/react.dso-toolkit.nl/www/${DT_REF} +rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./angular-workspace/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/angular.dso-toolkit.nl/www/${DT_REF} +rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./website/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/dso-toolkit.nl/www/${DT_REF} +rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/dso-toolkit/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/dso-toolkit/${DT_REF} +rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/core/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/@dso-toolkit/core/${DT_REF} + +if [[ -n ${DT_DIST_TAG+x} && $DT_DIST_TAG == "latest" ]] then yarn config set npmAuthToken "${DT_DEPLOY_NPM_TOKEN}" npm config set //registry.npmjs.org/:_authToken ${DT_DEPLOY_NPM_TOKEN} - yarn workspace @dso-toolkit/core version ${TRAVIS_TAG:1} --immediate - yarn workspace @dso-toolkit/react version ${TRAVIS_TAG:1} --immediate - yarn workspace dso-toolkit version ${TRAVIS_TAG:1} --immediate + yarn workspace @dso-toolkit/core version ${DT_REF} --immediate + yarn workspace @dso-toolkit/react version ${DT_REF} --immediate + yarn workspace dso-toolkit version ${DT_REF} --immediate yarn workspace dso-toolkit npm publish --access public yarn workspace @dso-toolkit/core npm publish --access public yarn workspace @dso-toolkit/react npm publish --access public cd angular-workspace/dist/component-library - npm version ${TRAVIS_TAG:1} + npm version ${DT_REF} npm publish cd ../../.. - gh release create ${TRAVIS_TAG} --generate-notes --verify-tag + gh release create v${DT_REF} --generate-notes --verify-tag - rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./storybook/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/storybook.dso-toolkit.nl/www/${TRAVIS_TAG:1} - rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./packages/react/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/react.dso-toolkit.nl/www/${TRAVIS_TAG:1} - rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./angular-workspace/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/angular.dso-toolkit.nl/www/${TRAVIS_TAG:1} - rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./website/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/dso-toolkit.nl/www/${TRAVIS_TAG:1} - rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/dso-toolkit/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/dso-toolkit/${TRAVIS_TAG:1} - rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/core/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/@dso-toolkit/core/${TRAVIS_TAG:1} + rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./storybook/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/storybook.dso-toolkit.nl/www/${DT_REF} + rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./packages/react/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/react.dso-toolkit.nl/www/${DT_REF} + rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./angular-workspace/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/angular.dso-toolkit.nl/www/${DT_REF} + rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive ./website/www/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/dso-toolkit.nl/www/${DT_REF} + rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/dso-toolkit/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/dso-toolkit/${DT_REF} + rsync --rsh "ssh -p ${DT_DEPLOY_PORT}" --delete --recursive --exclude 'node_modules' ./packages/core/ ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST}:${DT_DEPLOY_ROOT}/cdn.dso-toolkit.nl/www/@dso-toolkit/core/${DT_REF} fi ssh -p ${DT_DEPLOY_PORT} ${DT_DEPLOY_USER}@${DT_DEPLOY_HOST} "cd ${DT_DEPLOY_ROOT}/webhooks.dso-toolkit.nl && powershell -Command \"npm run update-versions\"" diff --git a/package.json b/package.json index bbbd181c89..d79d8e489d 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "axe-core": "^4.8.2", "concurrently": "^8.2.2", "cpy-cli": "^5.0.0", - "danger": "^11.3.0", + "danger": "11.3.1", "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-lit": "^1.10.1", diff --git a/packages/dso-toolkit/gulp/build-styling.js b/packages/dso-toolkit/gulp/build-styling.js index 9b4c33fa88..ccbf6e6344 100644 --- a/packages/dso-toolkit/gulp/build-styling.js +++ b/packages/dso-toolkit/gulp/build-styling.js @@ -12,17 +12,8 @@ function getVersion() { return process.env.DT_VERSION; } - if (process.env.CI) { - if (typeof process.env.TRAVIS_TAG === "string" && process.env.TRAVIS_TAG[0] === "v") { - return process.env.TRAVIS_TAG.substring(1); - } - - if ( - typeof process.env.TRAVIS_BRANCH === "string" && - (process.env.TRAVIS_BRANCH[0] === "#" || process.env.TRAVIS_BRANCH === "master") - ) { - return process.env.TRAVIS_BRANCH.replace(/#/, "_"); - } + if (process.env.CI && process.env.DT_REF) { + return process.env.DT_REF; } return undefined; diff --git a/storybook/.storybook/main.ts b/storybook/.storybook/main.ts index 3887f6ddec..a7c0bb63d1 100644 --- a/storybook/.storybook/main.ts +++ b/storybook/.storybook/main.ts @@ -6,16 +6,8 @@ import { resolve, dirname, parse, join } from "path"; const testStoryStoryV7 = false; function getVersion() { - if (process.env.CI) { - if (typeof process.env.TRAVIS_TAG === "string" && process.env.TRAVIS_TAG[0] === "v") { - return process.env.TRAVIS_TAG.substring(1); - } - if ( - typeof process.env.TRAVIS_BRANCH === "string" && - (process.env.TRAVIS_BRANCH[0] === "#" || process.env.TRAVIS_BRANCH === "master") - ) { - return process.env.TRAVIS_BRANCH.replace(/#/, "_"); - } + if (process.env.CI && process.env.DT_REF) { + return process.env.DT_REF; } return undefined; diff --git a/storybook/cypress.config.ts b/storybook/cypress.config.ts index 541ae3cd2b..b8fc6d7c89 100644 --- a/storybook/cypress.config.ts +++ b/storybook/cypress.config.ts @@ -1,9 +1,6 @@ import { defineConfig } from "cypress"; export default defineConfig({ - env: { - PERCY: !!process.env.PERCY_TOKEN, - }, e2e: { setupNodeEvents(_on, _config) { // This method is needed for Cypress /Th diff --git a/storybook/cypress/e2e/accordion.cy.ts b/storybook/cypress/e2e/accordion.cy.ts index fecf2e0cfa..eb2545069c 100644 --- a/storybook/cypress/e2e/accordion.cy.ts +++ b/storybook/cypress/e2e/accordion.cy.ts @@ -59,7 +59,7 @@ describe("Accordion", () => { }); it("should be accessible", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.injectAxe(); cy.checkA11y("dso-accordion"); diff --git a/storybook/cypress/e2e/action-list.cy.ts b/storybook/cypress/e2e/action-list.cy.ts index 37016fbc7e..86ab24e6ce 100644 --- a/storybook/cypress/e2e/action-list.cy.ts +++ b/storybook/cypress/e2e/action-list.cy.ts @@ -4,6 +4,6 @@ describe("ActionList", () => { }); it("screenshot", () => { - cy.percySnapshot(); + // cy.percySnapshot(); }); }); diff --git a/storybook/cypress/e2e/alert.cy.ts b/storybook/cypress/e2e/alert.cy.ts index c3c2fcaba1..92c5266dd4 100644 --- a/storybook/cypress/e2e/alert.cy.ts +++ b/storybook/cypress/e2e/alert.cy.ts @@ -32,7 +32,7 @@ describe("Alert", () => { .invoke("prop", "icon") .should("equal", icon); - cy.percySnapshot(); + // cy.percySnapshot(); }); } }); diff --git a/storybook/cypress/e2e/autosuggest.cy.ts b/storybook/cypress/e2e/autosuggest.cy.ts index 0bb22fd2c7..2281bb5814 100644 --- a/storybook/cypress/e2e/autosuggest.cy.ts +++ b/storybook/cypress/e2e/autosuggest.cy.ts @@ -15,7 +15,7 @@ describe("Autosuggest", () => { cy.checkA11y("dso-autosuggest"); cy.get("@listbox").get("li[role='option']").should("have.length", 10); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should regexp-escape suggestions", () => { diff --git a/storybook/cypress/e2e/date-picker-legacy.cy.ts b/storybook/cypress/e2e/date-picker-legacy.cy.ts index 191d974dfa..dcb108b3d7 100644 --- a/storybook/cypress/e2e/date-picker-legacy.cy.ts +++ b/storybook/cypress/e2e/date-picker-legacy.cy.ts @@ -14,7 +14,7 @@ describe("Date Picker (Legacy)", () => { cy.get(`label[for="${id}"]`).should("exist").and("not.be.empty"); }); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should have focus trap", () => { diff --git a/storybook/cypress/e2e/date-picker.cy.ts b/storybook/cypress/e2e/date-picker.cy.ts index e34229f5d9..d52a77ae56 100644 --- a/storybook/cypress/e2e/date-picker.cy.ts +++ b/storybook/cypress/e2e/date-picker.cy.ts @@ -13,7 +13,7 @@ describe("Date Picker", () => { }); cy.checkA11y("#root-inner"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should emit dsoDateChange event", () => { diff --git a/storybook/cypress/e2e/dropdown-menu.cy.ts b/storybook/cypress/e2e/dropdown-menu.cy.ts index 459120ff5c..e71b11fa49 100644 --- a/storybook/cypress/e2e/dropdown-menu.cy.ts +++ b/storybook/cypress/e2e/dropdown-menu.cy.ts @@ -11,7 +11,7 @@ describe("Dropdown menu - anchors", () => { }); it("should open and close on button click", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("@options").should("not.be.visible"); diff --git a/storybook/cypress/e2e/header.cy.ts b/storybook/cypress/e2e/header.cy.ts index 9f1547ed0e..a888f01b80 100644 --- a/storybook/cypress/e2e/header.cy.ts +++ b/storybook/cypress/e2e/header.cy.ts @@ -57,8 +57,10 @@ describe("Header", () => { it("should be accessible", () => { cy.checkA11y("dso-header"); - cy.percySnapshot().get("dso-header").invoke("attr", "useDropDownMenu", "always").checkA11y("dso-header"); - cy.percySnapshot(`${Cypress.currentTest.title}" -- dropdown menu`) + // cy.percySnapshot() + cy.get("dso-header").invoke("attr", "useDropDownMenu", "always").checkA11y("dso-header"); + cy + // .percySnapshot(`${Cypress.currentTest.title}" -- dropdown menu`) .viewport(400, 600) .get("dso-header") .invoke("attr", "useDropDownMenu", "auto") diff --git a/storybook/cypress/e2e/helpcenter-panel.cy.ts b/storybook/cypress/e2e/helpcenter-panel.cy.ts index 788818096c..2c2dfa6ad2 100644 --- a/storybook/cypress/e2e/helpcenter-panel.cy.ts +++ b/storybook/cypress/e2e/helpcenter-panel.cy.ts @@ -40,7 +40,7 @@ describe("Helpcenter panel", () => { }); it("should open panel on help button click", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("@iframeContainer") .should("have.class", "close") @@ -55,7 +55,7 @@ describe("Helpcenter panel", () => { .get("@openButton") .should("have.class", "open"); - cy.percySnapshot(`${Cypress.currentTest.title}" -- opened`); + // cy.percySnapshot(`${Cypress.currentTest.title}" -- opened`); }); it.skip("should not load iframe when panel is closed", () => { diff --git a/storybook/cypress/e2e/image-overlay.cy.ts b/storybook/cypress/e2e/image-overlay.cy.ts index d455327af3..511da85087 100644 --- a/storybook/cypress/e2e/image-overlay.cy.ts +++ b/storybook/cypress/e2e/image-overlay.cy.ts @@ -38,7 +38,7 @@ describe("Image Overlay", () => { it("should open and close overlay", () => { openOverlay(); - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("dso-image-overlay").shadow().find("button.close").click(); cy.get("dso-image-overlay").shadow().find(".wrapper > img").should("not.exist"); }); diff --git a/storybook/cypress/e2e/label.cy.ts b/storybook/cypress/e2e/label.cy.ts index 68f7336d26..3bcbc9649b 100644 --- a/storybook/cypress/e2e/label.cy.ts +++ b/storybook/cypress/e2e/label.cy.ts @@ -13,7 +13,7 @@ describe("Label", () => { } it("should be able to truncate label", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("@dsoLabel") .should("have.text", defaultLabelText) @@ -26,7 +26,7 @@ describe("Label", () => { .find(".dso-label-content") .should("exist"); - cy.percySnapshot(`${Cypress.currentTest.title} -- truncated`); + // cy.percySnapshot(`${Cypress.currentTest.title} -- truncated`); }); it("should show tooltip on focus", () => { diff --git a/storybook/cypress/e2e/list-button.cy.ts b/storybook/cypress/e2e/list-button.cy.ts index afc61d6e52..ee24b49c76 100644 --- a/storybook/cypress/e2e/list-button.cy.ts +++ b/storybook/cypress/e2e/list-button.cy.ts @@ -4,7 +4,7 @@ describe("ListButton", () => { }); it("should render label and sublabel correctly", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("dso-list-button") .as("dsoListButton") @@ -55,8 +55,8 @@ describe("ListButton", () => { .invoke("assignedNodes") .then((assignedNodes) => { cy.get('dso-list-button > [slot="subcontent"]').invoke("get", 0).should("equal", assignedNodes[0]); - }) - .percySnapshot(); + }); + // .percySnapshot(); cy.get("dso-list-button") .shadow() diff --git a/storybook/cypress/e2e/logo.cy.ts b/storybook/cypress/e2e/logo.cy.ts index de05f068bc..c0755b66dc 100644 --- a/storybook/cypress/e2e/logo.cy.ts +++ b/storybook/cypress/e2e/logo.cy.ts @@ -10,7 +10,7 @@ describe("Logo", () => { .find(".logo-label") .should("not.exist"); cy.get("dso-logo").shadow().find(".logo-wordmark").should("exist"); - cy.percySnapshot(); + // cy.percySnapshot(); cy.injectAxe(); cy.checkA11y("dso-logo"); }); @@ -23,7 +23,7 @@ describe("Logo", () => { .find(".logo-label") .should("be.visible"); cy.get("dso-logo").invoke("prop", "label", "Beheerportaal").shadow().find(".logo-wordmark").should("be.visible"); - cy.percySnapshot(); + // cy.percySnapshot(); cy.injectAxe(); cy.checkA11y("dso-logo"); }); @@ -42,7 +42,7 @@ describe("Logo", () => { .shadow() .find(".logo-wordmark") .should("not.be.visible"); - cy.percySnapshot(); + // cy.percySnapshot(); cy.injectAxe(); cy.checkA11y("dso-logo"); }); @@ -54,13 +54,13 @@ describe("Logo", () => { .find(".logo-ribbon") .should("be.visible") .should("have.text", "beta"); - cy.percySnapshot(); + // cy.percySnapshot(); cy.injectAxe(); cy.checkA11y("dso-logo"); }); it("should be accessible", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.injectAxe(); cy.checkA11y("dso-logo"); }); diff --git a/storybook/cypress/e2e/map-controls.cy.ts b/storybook/cypress/e2e/map-controls.cy.ts index 93d85fd6e3..e8366c5c26 100644 --- a/storybook/cypress/e2e/map-controls.cy.ts +++ b/storybook/cypress/e2e/map-controls.cy.ts @@ -59,7 +59,7 @@ describe("Map Controls", () => { .find("button span") .should("have.text", "Verberg paneel Kaartlagen"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should emit zoom events", () => { diff --git a/storybook/cypress/e2e/modal.cy.ts b/storybook/cypress/e2e/modal.cy.ts index 6883405dad..7bd7bd1c6a 100644 --- a/storybook/cypress/e2e/modal.cy.ts +++ b/storybook/cypress/e2e/modal.cy.ts @@ -24,7 +24,7 @@ describe("Modal", () => { .should("have.class", "sr-only") .and("have.text", "Sluiten"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should have focus trap", () => { diff --git a/storybook/cypress/e2e/ozon-content.cy.ts b/storybook/cypress/e2e/ozon-content.cy.ts index 6b6762967b..189b923f3e 100644 --- a/storybook/cypress/e2e/ozon-content.cy.ts +++ b/storybook/cypress/e2e/ozon-content.cy.ts @@ -9,7 +9,7 @@ describe("Ozon Content", () => { cy.get("@anchorClick").should("have.been.calledOnce"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should open and close notes", () => { @@ -31,7 +31,7 @@ describe("Ozon Content", () => { button("N7").should("have.attr", "aria-expanded", "false"); tooltip("N7").should("be.not.visible"); - cy.percySnapshot(); + // cy.percySnapshot(); button("N7").click(); @@ -40,7 +40,7 @@ describe("Ozon Content", () => { button("N7").should("have.attr", "aria-expanded", "true"); tooltip("N7").should("be.visible"); - cy.percySnapshot(`${Cypress.currentTest.title} -- visible notes`); + // cy.percySnapshot(`${Cypress.currentTest.title} -- visible notes`); button("N7").click(); @@ -59,7 +59,7 @@ describe("Ozon Content", () => { cy.get("dso-ozon-content").shadow().find("span.fallback.od-aap").should("exist").contains("baviaan"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render br element", () => { @@ -71,7 +71,7 @@ describe("Ozon Content", () => { cy.get("dso-ozon-content").shadow().find("span.fallback.od-e").children("br").should("exist").and("be.empty"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render Al element", () => { @@ -83,7 +83,7 @@ describe("Ozon Content", () => { cy.get("dso-ozon-content").shadow().find("p").should("exist").children('span[role="paragraph"]').should("exist"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render sub, sup, strong, b, i and u elements", () => { @@ -114,7 +114,7 @@ describe("Ozon Content", () => { .children("span.fallback.od-inner") .contains("text"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render Inhoud element and handle xml namespace", () => { @@ -135,7 +135,7 @@ describe("Ozon Content", () => { .children("span.od-e") .contains("de inhoud"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render IntRef element", () => { @@ -153,7 +153,7 @@ describe("Ozon Content", () => { .children("span.fallback.od-e") .contains("document"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render IntIoRef element", () => { @@ -164,7 +164,7 @@ describe("Ozon Content", () => { .find('a[href = "#gm0037_1__cmp_I__content_1__list_o_1__item_o_1__ref_o_1"]') .should("exist"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should emit anchorClick on IntIoRef anchor click", () => { @@ -185,7 +185,7 @@ describe("Ozon Content", () => { .its("args.0.detail.node") .should("equal", "IntIoRef"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render ExtRef element", () => { @@ -201,7 +201,7 @@ describe("Ozon Content", () => { .should("exist") .and("have.text", "document (Opent andere website in nieuw tabblad)"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render ExtIoRef element", () => { @@ -221,7 +221,7 @@ describe("Ozon Content", () => { "/join/id/regdata/pv25/2021/OKBebouwdEenOpHonderdWRIJ/nld@2021-11-14;1 (Opent andere website in nieuw tabblad)", ); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render Illustratie element", () => { @@ -236,7 +236,7 @@ describe("Ozon Content", () => { .find("img[src = 'afbeelding.jpg'][height = '12'][width = '34']") .should("exist"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render simple table", () => { @@ -254,7 +254,7 @@ describe("Ozon Content", () => { cy.get("@body").find("tr:nth-child(2) td:nth-child(1)").contains("3"); cy.get("@body").find("tr:nth-child(2) td:nth-child(2)").contains("4"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render table with heading", () => { @@ -270,7 +270,7 @@ describe("Ozon Content", () => { cy.get("@head").find("tr:nth-child(1) td:nth-child(1)").contains("een"); cy.get("@head").find("tr:nth-child(1) td:nth-child(2)").contains("twee"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render table with rowspan", () => { @@ -287,7 +287,7 @@ describe("Ozon Content", () => { cy.get("@body").find("tr:nth-child(1) td:nth-child(2)").contains("2"); cy.get("@body").find("tr:nth-child(2) td:nth-child(1)").contains("4"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render table with colspan", () => { @@ -306,7 +306,7 @@ describe("Ozon Content", () => { cy.get("@body").find("tr:nth-child(2) td:nth-child(1)").contains("3"); cy.get("@body").find("tr:nth-child(2) td:nth-child(2)").contains("4"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render inline paragraphs in Opschrift", () => { @@ -321,7 +321,7 @@ describe("Ozon Content", () => { .find("p") .should("not.exist"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should have correct display", () => { @@ -333,7 +333,7 @@ describe("Ozon Content", () => { .invoke("attr", "inline", null) .should("have.css", "display", "block"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render Figuur as dso-image-overlay", () => { @@ -373,7 +373,7 @@ describe("Ozon Content", () => { .find(".dso-ozon-figuur > .figuur-bijschrift") .should("have.text", "Bijschrift bij het figuur. (bron: Bron waaruit het figuur is overgenomen)"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render Lijst element", () => { @@ -497,7 +497,7 @@ describe("Ozon Content", () => { .get("@dsoOzonLijst") .find("> ul"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should render renvooi-weergave elements", () => { @@ -520,7 +520,7 @@ describe("Ozon Content", () => { .find("table.wijzigactie-voegtoe") .should("have.css", "background-color", "rgb(228, 241, 212)"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should show at a table", () => { diff --git a/storybook/cypress/e2e/pagination.cy.ts b/storybook/cypress/e2e/pagination.cy.ts index ceb271be09..c0fab4a645 100644 --- a/storybook/cypress/e2e/pagination.cy.ts +++ b/storybook/cypress/e2e/pagination.cy.ts @@ -30,7 +30,7 @@ describe("Pagination", () => { .find('a[aria-label="Volgende"]') .should("be.visible"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should not show ellipsis when page count is in range", () => { @@ -51,7 +51,7 @@ describe("Pagination", () => { .find("a") .should("have.text", "7"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should show ... when first and/or last page are out of range", () => { diff --git a/storybook/cypress/e2e/percy-components.cy.ts b/storybook/cypress/e2e/percy-components.cy.ts index fe4a092380..539a7280a4 100644 --- a/storybook/cypress/e2e/percy-components.cy.ts +++ b/storybook/cypress/e2e/percy-components.cy.ts @@ -3,7 +3,7 @@ import components from "../fixtures/percy-components.json"; import { percyHeaderFix } from "../support/percy-header-fix"; describe("Percy", () => { - if (!Cypress.env("PERCY")) { + if (!Cypress.env("PERCY") || (true as boolean)) { it("should not take screenshots", () => { cy.wrap(true).should("eq", true); }); @@ -17,7 +17,7 @@ describe("Percy", () => { percyHeaderFix(); - cy.percySnapshot(id); + // cy.percySnapshot(id); } }); }); diff --git a/storybook/cypress/e2e/percy-voorbeeldpaginas-core.cy.ts b/storybook/cypress/e2e/percy-voorbeeldpaginas-core.cy.ts index dab85d387d..6bd212a0ab 100644 --- a/storybook/cypress/e2e/percy-voorbeeldpaginas-core.cy.ts +++ b/storybook/cypress/e2e/percy-voorbeeldpaginas-core.cy.ts @@ -3,7 +3,7 @@ import voorbeeldpaginas from "../fixtures/percy-voorbeeldpaginas.json"; import { percyHeaderFix } from "../support/percy-header-fix"; describe("Percy", () => { - if (!Cypress.env("PERCY")) { + if (!Cypress.env("PERCY") || (true as boolean)) { it("should not take screenshots", () => { cy.wrap(true).should("eq", true); }); @@ -17,7 +17,7 @@ describe("Percy", () => { percyHeaderFix(); - cy.percySnapshot(`${id} (Core)`); + // cy.percySnapshot(`${id} (Core)`); } }); }); diff --git a/storybook/cypress/e2e/percy-voorbeeldpaginas-html-css.cy.ts b/storybook/cypress/e2e/percy-voorbeeldpaginas-html-css.cy.ts index 357c0d6f2a..1da4b37389 100644 --- a/storybook/cypress/e2e/percy-voorbeeldpaginas-html-css.cy.ts +++ b/storybook/cypress/e2e/percy-voorbeeldpaginas-html-css.cy.ts @@ -3,7 +3,7 @@ import voorbeeldpaginas from "../fixtures/percy-voorbeeldpaginas.json"; import { percyHeaderFix } from "../support/percy-header-fix"; describe("Percy", () => { - if (!Cypress.env("PERCY")) { + if (!Cypress.env("PERCY") || (true as boolean)) { it("should not take screenshots", () => { cy.wrap(true).should("eq", true); }); @@ -17,7 +17,7 @@ describe("Percy", () => { percyHeaderFix(); - cy.percySnapshot(`${id} (HTML/CSS)`); + // cy.percySnapshot(`${id} (HTML/CSS)`); } }); }); diff --git a/storybook/cypress/e2e/progress-indicator.cy.ts b/storybook/cypress/e2e/progress-indicator.cy.ts index df50e0282a..0a8b2a438d 100644 --- a/storybook/cypress/e2e/progress-indicator.cy.ts +++ b/storybook/cypress/e2e/progress-indicator.cy.ts @@ -41,20 +41,20 @@ describe("Progress Indicator", () => { .find(".dso-progress-indicator-label") .should("have.text", "Resultaten laden: een moment geduld alstublieft."); - cy.percySnapshot(`core-progress-indicator--${size}`); + // cy.percySnapshot(`core-progress-indicator--${size}`); }); } - for (const { size } of sizes) { - it(`should show ${size} spinner (HTML/CSS)`, () => { - cy.visit(`http://localhost:45000/iframe.html?id=html-css-progress-indicator--${size}`) - .get("body") - .then(($body) => { - $body.prepend(``); - }) - .get("#percy-fix") - .should("exist") - .percySnapshot(`html-css-progress-indicator--${size}`); - }); - } + // for (const { size } of sizes) { + // it(`should show ${size} spinner (HTML/CSS)`, () => { + // cy.visit(`http://localhost:45000/iframe.html?id=html-css-progress-indicator--${size}`) + // .get("body") + // .then(($body) => { + // $body.prepend(``); + // }) + // .get("#percy-fix") + // .should("exist") + // .percySnapshot(`html-css-progress-indicator--${size}`); + // }); + // } }); diff --git a/storybook/cypress/e2e/scrollable.cy.ts b/storybook/cypress/e2e/scrollable.cy.ts index bd18425e0b..5ee5a9bfe2 100644 --- a/storybook/cypress/e2e/scrollable.cy.ts +++ b/storybook/cypress/e2e/scrollable.cy.ts @@ -11,7 +11,7 @@ describe("Scrollable", () => { }); it("should scroll", () => { - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("@scrollContainer") .should("have.class", "dso-scroll-top") diff --git a/storybook/cypress/e2e/selectable.cy.ts b/storybook/cypress/e2e/selectable.cy.ts index 733586c4a3..8425f9ec1b 100644 --- a/storybook/cypress/e2e/selectable.cy.ts +++ b/storybook/cypress/e2e/selectable.cy.ts @@ -2,7 +2,7 @@ describe("Selectable", () => { it("should toggle info using instance method", () => { cy.visit("http://localhost:45000/iframe.html?id=core-selectable--with-info"); - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("dso-selectable .dso-rich-content").as("info-content").should("exist").and("not.be.visible"); diff --git a/storybook/cypress/e2e/slide-toggle.cy.ts b/storybook/cypress/e2e/slide-toggle.cy.ts index f42c859619..eb7b970cca 100644 --- a/storybook/cypress/e2e/slide-toggle.cy.ts +++ b/storybook/cypress/e2e/slide-toggle.cy.ts @@ -10,7 +10,7 @@ describe("Slide Toggle", () => { }); it("should render the slide-button states correctly", () => { - cy.percySnapshot(`${Cypress.currentTest.title}" -- off`); + // cy.percySnapshot(`${Cypress.currentTest.title}" -- off`); cy.injectAxe(); cy.checkA11y("dso-slide-toggle"); @@ -23,7 +23,7 @@ describe("Slide Toggle", () => { .should("have.attr", "aria-checked", "true") .wait(400); - cy.percySnapshot(`${Cypress.currentTest.title}" -- on`); + // cy.percySnapshot(`${Cypress.currentTest.title}" -- on`); cy.get("dso-slide-toggle") .invoke("attr", "disabled", true) @@ -31,7 +31,7 @@ describe("Slide Toggle", () => { .should("have.attr", "disabled") .wait(400); - cy.percySnapshot(`${Cypress.currentTest.title}" -- disabled`); + // cy.percySnapshot(`${Cypress.currentTest.title}" -- disabled`); }); it("should correctly set aria-label", () => { diff --git a/storybook/cypress/e2e/table.cy.ts b/storybook/cypress/e2e/table.cy.ts index b73de5c41e..8fa8f54903 100644 --- a/storybook/cypress/e2e/table.cy.ts +++ b/storybook/cypress/e2e/table.cy.ts @@ -18,7 +18,7 @@ describe("Table", () => { expect($tableBody[0].scrollWidth).to.be.greaterThan($tableBody[0].getBoundingClientRect().width), ); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should open and close an accessible modal", () => { diff --git a/storybook/cypress/e2e/toggletip.cy.ts b/storybook/cypress/e2e/toggletip.cy.ts index d195526cff..854468b7a3 100644 --- a/storybook/cypress/e2e/toggletip.cy.ts +++ b/storybook/cypress/e2e/toggletip.cy.ts @@ -21,7 +21,7 @@ describe("Toggletip", () => { it("should focus on button after escape", () => { prepareComponent(); - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("@dsoButton") .click() diff --git a/storybook/cypress/e2e/tooltip.cy.ts b/storybook/cypress/e2e/tooltip.cy.ts index aac22379d3..ceccc3a99c 100644 --- a/storybook/cypress/e2e/tooltip.cy.ts +++ b/storybook/cypress/e2e/tooltip.cy.ts @@ -23,7 +23,7 @@ describe("Tooltip", () => { // Temporary test, this shouldn't be needed. Don't copy/paste this. it("should look ok", () => { - cy.percySnapshot(); + // cy.percySnapshot(); }); it.skip("should show tooltip on focus on button and hide on escape key", () => { diff --git a/storybook/cypress/e2e/tree-view.cy.ts b/storybook/cypress/e2e/tree-view.cy.ts index 01a54d1fc8..cee0a0255b 100644 --- a/storybook/cypress/e2e/tree-view.cy.ts +++ b/storybook/cypress/e2e/tree-view.cy.ts @@ -63,7 +63,7 @@ describe("Tree View", () => { ); shouldHaveCorrectAriaTreeItemAttributes("bouwwerken", 2, 4, 3); - cy.percySnapshot(); + // cy.percySnapshot(); cy.get("@bouwwerken") .prev() diff --git a/storybook/cypress/e2e/viewer-grid.cy.ts b/storybook/cypress/e2e/viewer-grid.cy.ts index 5e9c1b22df..f20ae11a4a 100644 --- a/storybook/cypress/e2e/viewer-grid.cy.ts +++ b/storybook/cypress/e2e/viewer-grid.cy.ts @@ -12,7 +12,7 @@ describe("Viewer Grid", () => { it("should show overlay", () => { cy.visit(urlOverlayOpened); cy.get("dso-viewer-grid").shadow().find(".overlay").should("exist").and("have.attr", "open"); - cy.percySnapshot(); + // cy.percySnapshot(); }); it("should emit closeOverlay", () => { diff --git a/storybook/cypress/support/e2e.ts b/storybook/cypress/support/e2e.ts index b02e153047..dddd2e7969 100644 --- a/storybook/cypress/support/e2e.ts +++ b/storybook/cypress/support/e2e.ts @@ -16,6 +16,5 @@ // Import commands.js using ES2015 syntax: import "./commands"; -import "@percy/cypress"; import "cypress-axe"; import "cypress-real-events"; diff --git a/storybook/cypress/tsconfig.json b/storybook/cypress/tsconfig.json index d51cb49c3f..0277305da2 100644 --- a/storybook/cypress/tsconfig.json +++ b/storybook/cypress/tsconfig.json @@ -7,7 +7,7 @@ "noEmitOnError": true, "noUncheckedIndexedAccess": true, "esModuleInterop": true, - "types": ["cypress", "cypress-axe", "cypress-real-events", "@percy/cypress"] + "types": ["cypress", "cypress-axe", "cypress-real-events"] }, "include": ["../../packages/core/src/components.d.ts", "**/*.ts"] } diff --git a/storybook/package.json b/storybook/package.json index 5d86795794..9862a06e11 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -7,7 +7,7 @@ "cy:run": "cypress run", "e2e": "start-server-and-test 'yarn e2e:start' http-get://127.0.0.1:45000 'yarn e2e:test'", "e2e:start": "http-server --silent --port 45000 www", - "e2e:test": "percy exec -- cypress-parallel --verbose --script cy:run --threads 4 --weights-json cypress-parallel/parallel-weights.json --specsDir cypress/e2e --reporterModulePath ../node_modules/cypress-multi-reporters" + "e2e:test": "cypress-parallel --verbose --script cy:run --threads 4 --weights-json cypress-parallel/parallel-weights.json --specsDir cypress/e2e --reporterModulePath ../node_modules/cypress-multi-reporters" }, "dependencies": { "@babel/core": "^7.23.3", @@ -15,8 +15,6 @@ "@babel/preset-typescript": "^7.23.3", "@dso-toolkit/core": "workspace:^", "@infoprojects/prettier-config": "^1.0.0", - "@percy/cli": "^1.27.4", - "@percy/cypress": "^3.1.2", "@storybook/addon-a11y": "7.5.3", "@storybook/addon-actions": "7.5.3", "@storybook/addon-essentials": "7.5.3", diff --git a/travis/cicd.sh b/travis/cicd.sh deleted file mode 100644 index 98b0e052b6..0000000000 --- a/travis/cicd.sh +++ /dev/null @@ -1,58 +0,0 @@ -set -euo pipefail -IFS=$'\n\t' - -mkdir --verbose --parents ~/.docker/cli-plugins/ -curl --silent --location "https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64" > ~/.docker/cli-plugins/docker-buildx -chmod a+x ~/.docker/cli-plugins/docker-buildx -docker buildx install - -echo $DT_DOCKER_PAT | docker login ghcr.io --username $DT_DOCKER_USERNAME --password-stdin - -TAG=${TRAVIS_BRANCH/\#/} - -# dedupe check, npm audit, lint, build, build-www -docker build \ - --cache-to type=inline \ - --cache-from ghcr.io/dso-toolkit/dso-toolkit:master \ - --cache-from ghcr.io/dso-toolkit/dso-toolkit:${TAG} \ - --cache-from ghcr.io/dso-toolkit/dso-toolkit:${TAG}-source \ - --tag ghcr.io/dso-toolkit/dso-toolkit:${TAG} \ - --progress plain \ - --build-arg CI \ - --build-arg TRAVIS_BRANCH \ - --build-arg TRAVIS_TAG \ - --pull \ - . - -docker push ghcr.io/dso-toolkit/dso-toolkit:${TAG} & - -# e2e -docker run \ - --env CI \ - --env PERCY_TOKEN \ - --env TRAVIS_BRANCH \ - --env TRAVIS_BUILD_ID \ - --env TRAVIS_BUILD_NUMBER \ - --env TRAVIS_COMMIT \ - --env TRAVIS_PULL_REQUEST \ - --env TRAVIS_PULL_REQUEST_BRANCH \ - --volume /home/travis/build/dso-toolkit/dso-toolkit/storybook/cypress-parallel:/usr/src/app/storybook/cypress-parallel \ - ghcr.io/dso-toolkit/dso-toolkit:${TAG} \ - "yarn e2e" - -# deploy -docker run \ - --env CI \ - --env DT_PRIVATE_KEY_BASE64 \ - --env DT_DEPLOY_HOST \ - --env DT_DEPLOY_PORT \ - --env DT_DEPLOY_USER \ - --env DT_DEPLOY_ROOT \ - --env DT_DEPLOY_NPM_TOKEN \ - --env GH_TOKEN \ - --env TRAVIS_BRANCH \ - --env TRAVIS_TAG \ - ghcr.io/dso-toolkit/dso-toolkit:${TAG} \ - "bash deploy.sh" - -wait diff --git a/travis/create-build-environment.sh b/travis/create-build-environment.sh deleted file mode 100644 index 9019b9febf..0000000000 --- a/travis/create-build-environment.sh +++ /dev/null @@ -1,30 +0,0 @@ -set -euo pipefail -IFS=$'\n\t' - -mkdir --verbose --parents ~/.docker/cli-plugins/ -curl --silent --location "https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64" > ~/.docker/cli-plugins/docker-buildx -chmod a+x ~/.docker/cli-plugins/docker-buildx -docker buildx install - -echo $DT_DOCKER_PAT | docker login ghcr.io --username $DT_DOCKER_USERNAME --password-stdin - -BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} -TAG=${BRANCH/\#/} - -echo "Docker tag: $TAG" - -# create build environment -docker build \ - --target source \ - --cache-to type=inline \ - --cache-from ghcr.io/dso-toolkit/dso-toolkit:${TAG}-source \ - --cache-from ghcr.io/dso-toolkit/dso-toolkit:master-source \ - --tag ghcr.io/dso-toolkit/dso-toolkit:${TAG}-source \ - --progress plain \ - --build-arg CI \ - --build-arg TRAVIS_BRANCH \ - --build-arg TRAVIS_TAG \ - --pull \ - . - -docker push ghcr.io/dso-toolkit/dso-toolkit:${TAG}-source diff --git a/travis/pull-request-check.sh b/travis/pull-request-check.sh deleted file mode 100644 index 8f1d182322..0000000000 --- a/travis/pull-request-check.sh +++ /dev/null @@ -1,17 +0,0 @@ -set -euo pipefail -IFS=$'\n\t' - -echo $DT_DOCKER_PAT | docker login ghcr.io --username $DT_DOCKER_USERNAME --password-stdin - -TAG=${TRAVIS_PULL_REQUEST_BRANCH/\#/} - -# danger ci -docker run \ - --env CI \ - --env DANGER_GITHUB_API_TOKEN \ - --env TRAVIS_PULL_REQUEST \ - --env TRAVIS_REPO_SLUG \ - --env TRAVIS_JOB_ID \ - --env HAS_JOSH_K_SEAL_OF_APPROVAL \ - ghcr.io/dso-toolkit/dso-toolkit:${TAG}-source \ - "yarn danger-ci" diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 787ed5d53f..5a3d7f0e9a 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -15,21 +15,10 @@ function getVersion() { return process.env.DT_VERSION; } - if (process.env.CI) { - if (typeof process.env.TRAVIS_TAG === "string" && process.env.TRAVIS_TAG[0] === "v") { - console.info(`Using TRAVIS_TAG "${process.env.TRAVIS_TAG}".`); + if (process.env.CI && process.env.DT_REF) { + console.warn(`Using DT_REF "${process.env.DT_REF}".`); - return process.env.TRAVIS_TAG.substring(1); - } - - if ( - typeof process.env.TRAVIS_BRANCH === "string" && - (process.env.TRAVIS_BRANCH[0] === "#" || process.env.TRAVIS_BRANCH === "master") - ) { - console.info(`Using TRAVIS_BRANCH "${process.env.TRAVIS_BRANCH}".`); - - return process.env.TRAVIS_BRANCH.replace(/#/, "_"); - } + return process.env.DT_REF; } console.info("Unable to resolve version."); diff --git a/website/project.json b/website/project.json index 49aa81f7d6..21e4fa1823 100644 --- a/website/project.json +++ b/website/project.json @@ -13,9 +13,12 @@ "^styles", "^assets", "default", - { "env": "DT_VERSION" }, - { "env": "TRAVIS_TAG" }, - { "env": "TRAVIS_BRANCH" } + { + "env": "DT_VERSION" + }, + { + "env": "DT_REF" + } ], "outputs": ["{projectRoot}/www"] } diff --git a/yarn.lock b/yarn.lock index 6d5031aeea..5879d14840 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4686,193 +4686,6 @@ __metadata: languageName: node linkType: hard -"@percy/cli-app@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-app@npm:1.27.4" - dependencies: - "@percy/cli-command": "npm:1.27.4" - "@percy/cli-exec": "npm:1.27.4" - checksum: 2ea94a51364bff570ff1874af637f581c03041df67fa7240d707d2988db59f5e664be33984afd3b80f7ebd305d4e784ff377e96c430f48288c8c01f2838aa271 - languageName: node - linkType: hard - -"@percy/cli-build@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-build@npm:1.27.4" - dependencies: - "@percy/cli-command": "npm:1.27.4" - checksum: bc8ccb67a2440ff4cc9d46acfbfe01a081339e34ebf97b6c1874455ba748abfdbfd670541059c356bb64f8d0fdd6ee1b259b35343d08abc8090540232b019b36 - languageName: node - linkType: hard - -"@percy/cli-command@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-command@npm:1.27.4" - dependencies: - "@percy/config": "npm:1.27.4" - "@percy/core": "npm:1.27.4" - "@percy/logger": "npm:1.27.4" - bin: - percy-cli-readme: bin/readme.js - checksum: dff8715d2a5aab943b6eab09b14a9feeb01edc96861109718721a21c1541babb0860fa77fd2685c71e1cf64e50fcc95ec2b7b006123bc50b11bb78fddf44a8f2 - languageName: node - linkType: hard - -"@percy/cli-config@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-config@npm:1.27.4" - dependencies: - "@percy/cli-command": "npm:1.27.4" - checksum: 9a735699748b4c444dd4d1fc190c0d60941a3e270be99cd2d49f81b2b6d30e629845f530d26fec826bf952b8e736c647233de31e9fe97e71c70ec089fe0df329 - languageName: node - linkType: hard - -"@percy/cli-exec@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-exec@npm:1.27.4" - dependencies: - "@percy/cli-command": "npm:1.27.4" - cross-spawn: "npm:^7.0.3" - which: "npm:^2.0.2" - checksum: 70880fa122a98d64cfacfde4c184dc5341a021882b0e2556f3eae30c822a21b32e74130286b037b5c33375b9f822a0d581fa6d6fa967bc2556ce53e330e108f0 - languageName: node - linkType: hard - -"@percy/cli-snapshot@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-snapshot@npm:1.27.4" - dependencies: - "@percy/cli-command": "npm:1.27.4" - yaml: "npm:^2.0.0" - checksum: 12d63157948507bb00c35041893c10cec0a9b807699adfdb2df123a7d07de30ef9cba5d7654d9e2328cb74e9f1c63908bc283702de472a4b675470fe7a7287bf - languageName: node - linkType: hard - -"@percy/cli-upload@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/cli-upload@npm:1.27.4" - dependencies: - "@percy/cli-command": "npm:1.27.4" - fast-glob: "npm:^3.2.11" - image-size: "npm:^1.0.0" - checksum: 8c0d4681775ffb8b98afd05db54543642afc4e34393d3c80c09f2ed1d4884626e3a5e678270836cc624920d8910278946ca70ea28747376f113431f8c2e085a2 - languageName: node - linkType: hard - -"@percy/cli@npm:^1.27.4": - version: 1.27.4 - resolution: "@percy/cli@npm:1.27.4" - dependencies: - "@percy/cli-app": "npm:1.27.4" - "@percy/cli-build": "npm:1.27.4" - "@percy/cli-command": "npm:1.27.4" - "@percy/cli-config": "npm:1.27.4" - "@percy/cli-exec": "npm:1.27.4" - "@percy/cli-snapshot": "npm:1.27.4" - "@percy/cli-upload": "npm:1.27.4" - "@percy/client": "npm:1.27.4" - "@percy/logger": "npm:1.27.4" - bin: - percy: bin/run.cjs - checksum: 8bae40ba124856b233780103faa6ef1d759d87d62a682181a615bf1c2666ea62db5199857f3918caec1edf3e5b4b9d47244a2bb89bc2a13ce5a2a980b448cfb6 - languageName: node - linkType: hard - -"@percy/client@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/client@npm:1.27.4" - dependencies: - "@percy/env": "npm:1.27.4" - "@percy/logger": "npm:1.27.4" - checksum: 71bffcf2e2e65dfe2b254984da947021fa291ad66bcda33edcb7116d7d295e62b2630e9d61684921debe896ff96f8e04bcc048293e237cf2ce8651077335bf4a - languageName: node - linkType: hard - -"@percy/config@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/config@npm:1.27.4" - dependencies: - "@percy/logger": "npm:1.27.4" - ajv: "npm:^8.6.2" - cosmiconfig: "npm:^8.0.0" - yaml: "npm:^2.0.0" - checksum: 4cffc5a1633b35c42817579c696beaf60971a18a997d9fd8e706d7a335689c08e1c393c3e5383610960e65f91c762859c838c4829d63678e8d5800862f4ca45b - languageName: node - linkType: hard - -"@percy/core@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/core@npm:1.27.4" - dependencies: - "@percy/client": "npm:1.27.4" - "@percy/config": "npm:1.27.4" - "@percy/dom": "npm:1.27.4" - "@percy/logger": "npm:1.27.4" - "@percy/webdriver-utils": "npm:1.27.4" - content-disposition: "npm:^0.5.4" - cross-spawn: "npm:^7.0.3" - extract-zip: "npm:^2.0.1" - fast-glob: "npm:^3.2.11" - micromatch: "npm:^4.0.4" - mime-types: "npm:^2.1.34" - path-to-regexp: "npm:^6.2.0" - rimraf: "npm:^3.0.2" - ws: "npm:^8.0.0" - checksum: 5f47a986ba188bb1e26c7adbbac80fccdee183c3c62f826bd709207a000d6b7834ddc7aaa49559817124be400a13b6577ccf1236ced4f3284d0cc9af486f78c6 - languageName: node - linkType: hard - -"@percy/cypress@npm:^3.1.2": - version: 3.1.2 - resolution: "@percy/cypress@npm:3.1.2" - dependencies: - "@percy/sdk-utils": "npm:^1.3.1" - peerDependencies: - cypress: ">=3" - checksum: 95d70adc4fbd67d8479885816f677b14e48eb102bab969c8d557e16fd7f4d10834ed8ddfac6b0eb7d94896692129e8f7b8c7f8cf35265eee5ddc195de944dfdb - languageName: node - linkType: hard - -"@percy/dom@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/dom@npm:1.27.4" - checksum: ad126c420102b2528be1c67027ab2bafadb6fa7c0b678741c99b63f1a9c87b220a280691a8e65982b3d7b13be2905a9e5e9b1cb8370b83b2fbe016409b837b9b - languageName: node - linkType: hard - -"@percy/env@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/env@npm:1.27.4" - dependencies: - "@percy/logger": "npm:1.27.4" - checksum: 88f4041d80fa08bf21c8a261f2be54254b89e6e2890428531483189b30aa174c70b70beaf30fe77c0dd9056fcb0c4ff4b007a341a984e98c4c2fea052768e02b - languageName: node - linkType: hard - -"@percy/logger@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/logger@npm:1.27.4" - checksum: f9c67ecf014d3c7617502e63bed7f154a507fbb0c3f7488dec385f93fee02458632b491baf664db3838c4c60088fb599be4314f3fbd8dc97f941294f97982b69 - languageName: node - linkType: hard - -"@percy/sdk-utils@npm:1.27.4, @percy/sdk-utils@npm:^1.3.1": - version: 1.27.4 - resolution: "@percy/sdk-utils@npm:1.27.4" - checksum: c3ebc5c28b2a36c556627441366f8ee30a7dcb63109d233178ae4cc0d20f53efbf3b4f3a2926d04c9726eb88d213bd7eef08626087549f82fb3cec59dc097889 - languageName: node - linkType: hard - -"@percy/webdriver-utils@npm:1.27.4": - version: 1.27.4 - resolution: "@percy/webdriver-utils@npm:1.27.4" - dependencies: - "@percy/config": "npm:1.27.4" - "@percy/sdk-utils": "npm:1.27.4" - checksum: 57719e408bf12877767214db87f7fafd4bc22017af14588485a418719c31955b355e91164c8be79559949adf2e86f455f96a2ba0a5eb4bb03567dddc427cc1f2 - languageName: node - linkType: hard - "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -8996,7 +8809,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:8.12.0, ajv@npm:^8.0.0, ajv@npm:^8.0.1, ajv@npm:^8.12.0, ajv@npm:^8.6.2, ajv@npm:^8.9.0": +"ajv@npm:8.12.0, ajv@npm:^8.0.0, ajv@npm:^8.0.1, ajv@npm:^8.12.0, ajv@npm:^8.9.0": version: 8.12.0 resolution: "ajv@npm:8.12.0" dependencies: @@ -11631,7 +11444,7 @@ __metadata: languageName: node linkType: hard -"content-disposition@npm:0.5.4, content-disposition@npm:^0.5.4": +"content-disposition@npm:0.5.4": version: 0.5.4 resolution: "content-disposition@npm:0.5.4" dependencies: @@ -11820,7 +11633,7 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^8.0.0, cosmiconfig@npm:^8.2.0, cosmiconfig@npm:^8.3.6": +"cosmiconfig@npm:^8.2.0, cosmiconfig@npm:^8.3.6": version: 8.3.6 resolution: "cosmiconfig@npm:8.3.6" dependencies: @@ -12416,9 +12229,9 @@ __metadata: languageName: node linkType: hard -"danger@npm:^11.3.0": - version: 11.3.0 - resolution: "danger@npm:11.3.0" +"danger@npm:11.3.1": + version: 11.3.1 + resolution: "danger@npm:11.3.1" dependencies: "@gitbeaker/core": "npm:^35.8.1" "@gitbeaker/node": "npm:^35.8.1" @@ -12468,7 +12281,7 @@ __metadata: danger-process: distribution/commands/danger-process.js danger-reset-status: distribution/commands/danger-reset-status.js danger-runner: distribution/commands/danger-runner.js - checksum: 7e18ec35c7b5a3cde18c244c501af56a2883da265c3fe0c62479067963728e1bafad222d60171c1f9728138630eb848253efd119f220dcd0c5e9153e0cbbfb3a + checksum: 2a643e4be29196231079c560d70f322de7ff4b3498db3f03e519d7873a1ce7db871d4652969225d788198bc838e2bad7f9aa98f0eeef3de7615f002def13090b languageName: node linkType: hard @@ -13273,8 +13086,6 @@ __metadata: "@babel/preset-typescript": "npm:^7.23.3" "@dso-toolkit/core": "workspace:^" "@infoprojects/prettier-config": "npm:^1.0.0" - "@percy/cli": "npm:^1.27.4" - "@percy/cypress": "npm:^3.1.2" "@storybook/addon-a11y": "npm:7.5.3" "@storybook/addon-actions": "npm:7.5.3" "@storybook/addon-essentials": "npm:7.5.3" @@ -13323,7 +13134,7 @@ __metadata: axe-core: "npm:^4.8.2" concurrently: "npm:^8.2.2" cpy-cli: "npm:^5.0.0" - danger: "npm:^11.3.0" + danger: "npm:11.3.1" eslint: "npm:^8.54.0" eslint-config-prettier: "npm:^9.0.0" eslint-plugin-lit: "npm:^1.10.1" @@ -14915,7 +14726,7 @@ __metadata: languageName: node linkType: hard -"extract-zip@npm:2.0.1, extract-zip@npm:^2.0.1": +"extract-zip@npm:2.0.1": version: 2.0.1 resolution: "extract-zip@npm:2.0.1" dependencies: @@ -17442,7 +17253,7 @@ __metadata: languageName: node linkType: hard -"image-size@npm:^1.0.0, image-size@npm:^1.0.2": +"image-size@npm:^1.0.2": version: 1.0.2 resolution: "image-size@npm:1.0.2" dependencies: @@ -21108,7 +20919,7 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27, mime-types@npm:^2.1.31, mime-types@npm:^2.1.34, mime-types@npm:~2.1.17, mime-types@npm:~2.1.19, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": +"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27, mime-types@npm:^2.1.31, mime-types@npm:~2.1.17, mime-types@npm:~2.1.19, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": version: 2.1.35 resolution: "mime-types@npm:2.1.35" dependencies: @@ -23128,13 +22939,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^6.2.0": - version: 6.2.1 - resolution: "path-to-regexp@npm:6.2.1" - checksum: 1e266be712d1a08086ee77beab12a1804842ec635dfed44f9ee1ba960a0e01cec8063fb8c92561115cdc0ce73158cdc7766e353ffa039340b4a85b370084c4d4 - languageName: node - linkType: hard - "path-type@npm:^1.0.0": version: 1.1.0 resolution: "path-type@npm:1.1.0" @@ -30215,7 +30019,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.0.0, ws@npm:^8.13.0, ws@npm:^8.2.3": +"ws@npm:^8.13.0, ws@npm:^8.2.3": version: 8.13.0 resolution: "ws@npm:8.13.0" peerDependencies: @@ -30344,7 +30148,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.0.0, yaml@npm:^2.2.2": +"yaml@npm:^2.2.2": version: 2.3.1 resolution: "yaml@npm:2.3.1" checksum: 66501d597e43766eb94dc175d28ec8b2c63087d6a78783e59b4218eee32b9172740f9f27d54b7bc0ca8af61422f7134929f9974faeaac99d583787e793852fd2