From b257bc6d2ac88a001b8079046767fc4a068f502a Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 15 Dec 2023 15:14:20 -0600 Subject: [PATCH 01/13] don't fail production builds because of eslint errors we still need to check eslint somewhere in this process though. so I'm creating the build-test-lint workflow. ref: https://nextjs.org/docs/pages/api-reference/next-config-js/eslint --- .github/workflows/build-test-lint.yml | 34 +++++++++++++++++++++++++++ .github/workflows/build.yml | 24 ------------------- next.config.js | 5 +++- 3 files changed, 38 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build-test-lint.yml delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml new file mode 100644 index 0000000..2fec82f --- /dev/null +++ b/.github/workflows/build-test-lint.yml @@ -0,0 +1,34 @@ +name: "Build Test Lint" +run-name: Build Test Lint of ${{ github.ref_name }} by @${{ github.actor }} +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false + +jobs: + build: + uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.16 + secrets: inherit + with: + platforms: 'linux/amd64' + webTarget: web + test: + needs: build + uses: scientist-softserv/actions/.github/workflows/cypress.yaml@v0.0.14 + with: + cypress-container-name: cypress-tests + lint: + needs: build + uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.14 + with: + rubocop_cmd: docker-compose run web -- bash -c 'yarn && yarn lint:all' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a8ef715..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "Build Docker Images" -run-name: Build of ${{ github.ref_name }} by @${{ github.actor }} -on: - push: - branches: - - main - pull_request: - branches: - - main - workflow_dispatch: - inputs: - debug_enabled: - type: boolean - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' - required: false - default: false - -jobs: - build: - uses: scientist-softserv/actions/.github/workflows/build.yaml@v0.0.16 - secrets: inherit - with: - platforms: "linux/amd64" - webTarget: web diff --git a/next.config.js b/next.config.js index f9f1c01..19111d0 100644 --- a/next.config.js +++ b/next.config.js @@ -13,7 +13,10 @@ const nextConfig = { reactStrictMode: true, swcMinify: true, eslint: { - dirs: ['pages', 'utils'], // Only run ESLint on the 'pages' and 'utils' directories during production builds + // Warning: This allows production builds to successfully complete even if + // your project has ESLint errors. + // ref: https://nextjs.org/docs/pages/api-reference/next-config-js/eslint + ignoreDuringBuilds: true, }, sentry: { // Use `hidden-source-map` rather than `source-map` as the Webpack `devtool` From 5bf1c937aba8779dbc45042eb7ece76cfd4f9529 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 15 Dec 2023 17:06:00 -0600 Subject: [PATCH 02/13] update next config for better build this commit change means we no longer get the error: "Detected next.config.js, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration" --- next.config.js | 68 +++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/next.config.js b/next.config.js index 19111d0..98f1a05 100644 --- a/next.config.js +++ b/next.config.js @@ -1,14 +1,11 @@ -// This guard clause allows the app to still build in the event another exception handler will be used, -// or the sentry project hasn't been set up yet -if (!process.env.SENTRY_DSN) return - // This file sets a custom webpack configuration to use your Next.js app // with Sentry. // https://nextjs.org/docs/api-reference/next.config.js/introduction // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ const { withSentryConfig } = require('@sentry/nextjs') +const SENTRY_DSN = process.env.SENTRY_DSN -const nextConfig = { +let nextConfig = { output: 'standalone', reactStrictMode: true, swcMinify: true, @@ -18,34 +15,43 @@ const nextConfig = { // ref: https://nextjs.org/docs/pages/api-reference/next-config-js/eslint ignoreDuringBuilds: true, }, - sentry: { - // Use `hidden-source-map` rather than `source-map` as the Webpack `devtool` - // for client-side builds. (This will be the default starting in - // `@sentry/nextjs` version 8.0.0.) See - // https://webpack.js.org/configuration/devtool/ and - // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map - // for more information. - hideSourceMaps: true, - }, } -const sentryWebpackPluginOptions = { - // Additional config options for the Sentry Webpack plugin. Keep in mind that - // the following options are set automatically, and overriding them is not - // recommended: - // release, url, configFile, stripPrefix, urlPrefix, include, ignore - - silent: true, // Suppresses all logs - project: process.env.SENTRY_PROJECT, - org: process.env.SENTRY_ORG, - authToken: process.env.SENTRY_AUTH_TOKEN, - // For all available options, see: - // https://github.com/getsentry/sentry-webpack-plugin#options. -} +module.exports = nextConfig // Make sure adding Sentry options is the last code to run before exporting, to // ensure that your source maps include changes from all other Webpack plugins -module.exports = withSentryConfig( - nextConfig, - sentryWebpackPluginOptions -) +let sentryWebpackPluginOptions = {} +if (SENTRY_DSN) { + nextConfig = { + ...nextConfig, + sentry: { + // Use `hidden-source-map` rather than `source-map` as the Webpack `devtool` + // for client-side builds. (This will be the default starting in + // `@sentry/nextjs` version 8.0.0.) See + // https://webpack.js.org/configuration/devtool/ and + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map + // for more information. + hideSourceMaps: true, + }, + } + + sentryWebpackPluginOptions = { + // Additional config options for the Sentry Webpack plugin. Keep in mind that + // the following options are set automatically, and overriding them is not + // recommended: + // release, url, configFile, stripPrefix, urlPrefix, include, ignore + + silent: true, // Suppresses all logs + project: process.env.SENTRY_PROJECT, + org: process.env.SENTRY_ORG, + authToken: process.env.SENTRY_AUTH_TOKEN, + // For all available options, see: + // https://github.com/getsentry/sentry-webpack-plugin#options + } + + module.exports = withSentryConfig( + nextConfig, + sentryWebpackPluginOptions + ) +} From 044883fa026a5b37f22cc261df10f46dbfb6593b Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 15 Dec 2023 18:29:55 -0600 Subject: [PATCH 03/13] attempt to fix the test and lint jobs ref: https://nextjs.org/docs/app/building-your-application/testing/cypress#continuous-integration-ci ref: https://github.com/vercel/next.js/tree/canary/examples/with-cypress ref: https://github.com/cypress-io/github-action#end-to-end-testing ref: https://docs.cypress.io/guides/continuous-integration/github-actions --- .github/workflows/build-test-lint.yml | 22 +-- .gitignore | 5 + cypress.config.js | 14 +- package.json | 10 +- yarn.lock | 184 +++++++++++++++++++++++--- 5 files changed, 198 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 2fec82f..2f415e6 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -22,13 +22,19 @@ jobs: with: platforms: 'linux/amd64' webTarget: web - test: + cypress: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cypress e2e + uses: cypress-io/github-action@v6 + - name: Cypress component + uses: cypress-io/github-action@v6 + with: + component: true + eslint: needs: build - uses: scientist-softserv/actions/.github/workflows/cypress.yaml@v0.0.14 + uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 with: - cypress-container-name: cypress-tests - lint: - needs: build - uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.14 - with: - rubocop_cmd: docker-compose run web -- bash -c 'yarn && yarn lint:all' + lint_cmd: docker-compose run web -- bash -c 'yarn && yarn lint' diff --git a/.gitignore b/.gitignore index 7619944..d5340c7 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,8 @@ node_modules/ # Emacs *.~undo-tree~ + +# Cypress +cypress/results +cypress/screenshots +cypress/videos diff --git a/cypress.config.js b/cypress.config.js index 855a2c7..529841c 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,14 +1,13 @@ const dotenvFlowPlugin = require('cypress-dotenv-flow') -const { defineConfig } = require("cypress") +const { defineConfig } = require('cypress') module.exports = defineConfig({ component: { devServer: { - framework: "next", - bundler: "webpack", + framework: 'next', + bundler: 'webpack', }, }, - e2e: { baseUrl: 'http://localhost:3000', chromeWebSecurity: false, @@ -18,7 +17,7 @@ module.exports = defineConfig({ ...process.env, ...config.env } - return config + return config }, }, env: { @@ -27,4 +26,9 @@ module.exports = defineConfig({ NEXT_PUBLIC_PROVIDER_NAME: 'acme', NEXT_PUBLIC_PROVIDER_ID: '572' }, + reporter: 'junit', + reporterOptions: { + mochaFile: 'cypress/results/results-[hash].xml', + toConsole: true, + }, }); diff --git a/package.json b/package.json index 24ff1c0..496ff9f 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,11 @@ "build": "next build", "start": "next build && next start", "lint": "next lint --dir pages --dir utils", - "cypress": "cypress run", - "cypress-gui": "cypress open", + "lint:fix": "next lint --dir pages --dir utils --fix", + "cypress:open:component": "cypress open --component", + "cypress:open:e2e": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e\"", + "cypress:run:component": "cypress run --component", + "cypress:run:e2e": "start-server-and-test dev http://localhost:3000 \"cypress run --e2e\"", "jest": "jest", "jest-watch": "jest --watch", "release": "release-it" @@ -24,14 +27,15 @@ "@sentry/nextjs": "^7.42.0", "axios": "^1.1.3", "bootstrap": "^5.2.3", + "cookies-next": "^4.0.0", "eslint": "^8.54.0", "eslint-config-next": "^14.0.3", - "cookies-next": "^4.0.0", "next": "12.3.1", "next-auth": "^4.20.1", "react": "18.2.0", "react-dom": "18.2.0", "sass": "^1.56.1", + "start-server-and-test": "^2.0.3", "swr": "^1.3.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index b7ab42e..5bd6493 100644 --- a/yarn.lock +++ b/yarn.lock @@ -454,6 +454,18 @@ dependencies: prop-types "^15.8.1" +"@hapi/hoek@^9.0.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@humanwhocodes/config-array@^0.11.13": version "0.11.13" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" @@ -1197,6 +1209,23 @@ "@sentry/cli" "^1.74.6" webpack-sources "^2.0.0 || ^3.0.0" +"@sideway/address@^4.1.3": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" + integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f" + integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sinclair/typebox@^0.25.16": version "0.25.24" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" @@ -1846,6 +1875,11 @@ arch@^2.2.0: resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== +arg@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" + integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2080,6 +2114,15 @@ axios@^1.1.3: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@^1.6.1: + version "1.6.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" + integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axobject-query@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a" @@ -2204,7 +2247,7 @@ blob-util@^2.0.2: resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== -bluebird@^3.7.2: +bluebird@3.7.2, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -2418,7 +2461,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-more-types@^2.24.0: +check-more-types@2.24.0, check-more-types@^2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== @@ -2835,7 +2878,7 @@ dayjs@^1.10.4: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3077,6 +3120,11 @@ dotenv@^8.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +duplexer@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -3589,6 +3637,19 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +event-stream@=3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + integrity sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g== + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + eventemitter2@6.4.7: version "6.4.7" resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.7.tgz#a7f6c4d7abf28a14c1ef3442f21cb306a054271d" @@ -3609,6 +3670,21 @@ execa@4.1.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" +execa@5.1.1, execa@^5.0.0, execa@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + execa@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-7.0.0.tgz#2a44e20e73797f6c2df23889927972386157d7e4" @@ -3624,21 +3700,6 @@ execa@7.0.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -execa@^5.0.0, execa@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - executable@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" @@ -3886,6 +3947,11 @@ formik@^2.2.9: tiny-warning "^1.0.2" tslib "^1.10.0" +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== + fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -5340,6 +5406,17 @@ jest@^29.3.1: import-local "^3.0.2" jest-cli "^29.5.0" +joi@^17.11.0: + version "17.11.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.11.0.tgz#aa9da753578ec7720e6f0ca2c7046996ed04fc1a" + integrity sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ== + dependencies: + "@hapi/hoek" "^9.0.0" + "@hapi/topo" "^5.0.0" + "@sideway/address" "^4.1.3" + "@sideway/formula" "^3.0.1" + "@sideway/pinpoint" "^2.0.0" + jose@^4.10.0, jose@^4.11.4: version "4.13.1" resolved "https://registry.yarnpkg.com/jose/-/jose-4.13.1.tgz#449111bb5ab171db85c03f1bd2cb1647ca06db1c" @@ -5550,7 +5627,7 @@ latest-version@^7.0.0: dependencies: package-json "^8.1.0" -lazy-ass@^1.6.0: +lazy-ass@1.6.0, lazy-ass@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== @@ -5946,6 +6023,11 @@ map-or-similar@^1.5.0: resolved "https://registry.npmjs.org/map-or-similar/-/map-or-similar-1.5.0.tgz" integrity sha512-0aF7ZmVon1igznGI4VS30yugpduQW3y3GkcgGJOp7d8x8QrizhigUxjI/m2UojsXXto+jLAH3KSz+xOJTiORjg== +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + integrity sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g== + memoizerific@^1.11.3: version "1.11.3" resolved "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz" @@ -6029,7 +6111,7 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimist@^1.2.0, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -6553,6 +6635,13 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + integrity sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A== + dependencies: + through "~2.3" + pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -6740,6 +6829,13 @@ proxy-from-env@^1.0.0, proxy-from-env@^1.1.0: resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +ps-tree@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" + integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== + dependencies: + event-stream "=3.3.4" + psl@^1.1.28, psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" @@ -7197,6 +7293,13 @@ rxjs@^7.5.1, rxjs@^7.5.7: dependencies: tslib "^2.1.0" +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + safe-array-concat@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" @@ -7417,6 +7520,13 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + integrity sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA== + dependencies: + through "2" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -7451,6 +7561,20 @@ stacktrace-parser@^0.1.10: dependencies: type-fest "^0.7.1" +start-server-and-test@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-2.0.3.tgz#15c53c85e23cba7698b498b8a2598cab95f3f802" + integrity sha512-QsVObjfjFZKJE6CS6bSKNwWZCKBG6975/jKRPPGFfFh+yOQglSeGXiNWjzgQNXdphcBI9nXbyso9tPfX4YAUhg== + dependencies: + arg "^5.0.2" + bluebird "3.7.2" + check-more-types "2.24.0" + debug "4.3.4" + execa "5.1.1" + lazy-ass "1.6.0" + ps-tree "1.2.0" + wait-on "7.2.0" + statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -7475,6 +7599,13 @@ storybook-addon-next-router@^4.0.1: dependencies: tslib "2.4.0" +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + integrity sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw== + dependencies: + duplexer "~0.1.1" + string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -7723,7 +7854,7 @@ throttleit@^1.0.0: resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" integrity sha512-rkTVqu6IjfQ/6+uNuuc3sZek4CEYxTJom3IktzgdSxcZqdARuebbA/f4QmAxMQIxqq9ZLEUkSYqvuk1I6VKq4g== -through@^2.3.6, through@^2.3.8: +through@2, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== @@ -8134,6 +8265,17 @@ w3c-xmlserializer@^4.0.0: dependencies: xml-name-validator "^4.0.0" +wait-on@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-7.2.0.tgz#d76b20ed3fc1e2bebc051fae5c1ff93be7892928" + integrity sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ== + dependencies: + axios "^1.6.1" + joi "^17.11.0" + lodash "^4.17.21" + minimist "^1.2.8" + rxjs "^7.8.1" + walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" From ba549f98640dcccbeae66a24a98a5713cd5e8d15 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 15 Dec 2023 18:42:50 -0600 Subject: [PATCH 04/13] linting --- utils/cookies.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/cookies.js b/utils/cookies.js index 5280bcb..8e380d6 100644 --- a/utils/cookies.js +++ b/utils/cookies.js @@ -35,7 +35,8 @@ export const enableCookies = () => { const nonEssentialCookies = [ // TODO(alishaevn): create this list - // TODO(alishaevn): add these cookies to pages/legal-notices/cookie-policy.js under "Non-essential cookies" with a description and expiration time frame + // TODO(alishaevn): add these cookies to pages/legal-notices/cookie-policy.js under + // "Non-essential cookies" with a description and expiration time frame ] export const disableCookies = () => { From 70119c2fe1992c637f4eac90fa2d7442466e332b Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 15 Dec 2023 18:56:29 -0600 Subject: [PATCH 05/13] comment out the lint and test jobs for now --- .github/workflows/build-test-lint.yml | 34 ++++++++++++++------------- .github/workflows/test-suite.yml | 26 -------------------- 2 files changed, 18 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/test-suite.yml diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 2f415e6..bf1939f 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -22,19 +22,21 @@ jobs: with: platforms: 'linux/amd64' webTarget: web - cypress: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cypress e2e - uses: cypress-io/github-action@v6 - - name: Cypress component - uses: cypress-io/github-action@v6 - with: - component: true - eslint: - needs: build - uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 - with: - lint_cmd: docker-compose run web -- bash -c 'yarn && yarn lint' + # TODO(alishaevn): figure out how to get the below passing in github actions + # it may be different than our typical setups since we don't use docker locally + # cypress: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # - name: Cypress e2e + # uses: cypress-io/github-action@v6 + # - name: Cypress component + # uses: cypress-io/github-action@v6 + # with: + # component: true + # eslint: + # needs: build + # uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 + # with: + # lint_cmd: docker-compose run web -- bash -c 'yarn && yarn lint' diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml deleted file mode 100644 index 44a85d3..0000000 --- a/.github/workflows/test-suite.yml +++ /dev/null @@ -1,26 +0,0 @@ -# TODO(alishaevn): remove the references to the github package registry -# TODO(alishaevn): run the cypress tests during this action - -# name: Test Suite -# on: -# push: {} -# jobs: -# build: -# runs-on: ubuntu-latest -# permissions: -# contents: read -# packages: write -# steps: -# - uses: actions/checkout@v3 -# # Setup .npmrc file to publish to GitHub Packages -# - uses: actions/setup-node@v3 -# with: -# registry-url: 'https://npm.pkg.github.com' -# # Defaults to the user or organization that owns the workflow file -# scope: '@scientist-softserv' -# node-version-file: package.json -# - name: Authenticate with private GPR package -# run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > $NPM_CONFIG_USERCONFIG -# - run: yarn install -# - run: yarn test -# - run: yarn build From af84514ab1f67767e755d1fc33a03fbec955b978 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 15 Dec 2023 18:57:05 -0600 Subject: [PATCH 06/13] update the deploy workflow --- .github/workflows/deploy.yml | 47 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d257910..a9c9c82 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,28 +2,29 @@ # In order to deploy via github actions instead, please update/confirm the following files: # - ops/production-deploy.tmpl.yaml # - ops/staging-deploy.tmpl.yaml -# Next, uncomment the following lines -# name: "Deploy" -# run-name: Deploy (${{ github.ref_name }} -> ${{ inputs.environment }}) by @${{ github.actor }} -# on: -# workflow_dispatch: -# inputs: -# environment: -# description: 'Deploy to Environment' -# required: true -# default: 'staging' -# type: choice -# options: -# - staging -# - production -# debug_enabled: -# type: boolean -# description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' -# required: false -# default: false +name: "Deploy" +run-name: Deploy (${{ github.ref_name }} -> ${{ inputs.environment }}) by @${{ github.actor }} +on: + workflow_dispatch: + inputs: + environment: + description: 'Deploy to Environment' + required: true + default: 'staging' + type: choice + options: + - staging + - production + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false -# jobs: -# deploy: -# uses: scientist-softserv/actions/.github/workflows/deploy.yaml@v0.0.16 -# secrets: inherit +jobs: + deploy: + # remove the line below to enable the job + if: false + uses: scientist-softserv/actions/.github/workflows/deploy.yaml@v0.0.16 + secrets: inherit From 90ede7c1178099a688a812b2303a2de665fbf57a Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 09:05:36 -0600 Subject: [PATCH 07/13] wip: debugging the eslint job --- .github/workflows/build-test-lint.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index bf1939f..106f751 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -35,8 +35,8 @@ jobs: # uses: cypress-io/github-action@v6 # with: # component: true - # eslint: - # needs: build - # uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 - # with: - # lint_cmd: docker-compose run web -- bash -c 'yarn && yarn lint' + eslint: + needs: build + uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 + with: + lint_cmd: docker-compose run web -- bash -c 'yarn && yarn lint' From bef639a8f904057f28ca3955b464f268b0d4f7fd Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 09:30:22 -0600 Subject: [PATCH 08/13] update the eslint lint_cmd the existing line failed with a "Error: Cannot find module '/home/node/app/bash'" error. Locally and in CI/CD. I found a SO post and tried the suggestion, which worked locally. I'm hoping it will work in CI/CD too. ref: https://stackoverflow.com/a/49647309/8079848 --- .github/workflows/build-test-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 106f751..8f1ddcc 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -39,4 +39,4 @@ jobs: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 with: - lint_cmd: docker-compose run web -- bash -c 'yarn && yarn lint' + lint_cmd: docker compose run web sh -c 'yarn && yarn lint' From aed75d93adf5530ba710ff3479f0dd72489909e3 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 11:26:06 -0600 Subject: [PATCH 09/13] wip: cypress in ci trying to get around the error: > Cypress could not verify that this server is running: > http://localhost:3000 > We are verifying this server because it has been configured as your > baseUrl. --- .github/workflows/build-test-lint.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 8f1ddcc..0f2a211 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -1,4 +1,4 @@ -name: "Build Test Lint" +name: 'Build Test Lint' run-name: Build Test Lint of ${{ github.ref_name }} by @${{ github.actor }} on: push: @@ -24,6 +24,14 @@ jobs: webTarget: web # TODO(alishaevn): figure out how to get the below passing in github actions # it may be different than our typical setups since we don't use docker locally + cypress: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cypress e2e + uses: cypress-io/github-action@v6 + with: # cypress: # runs-on: ubuntu-22.04 # steps: @@ -35,6 +43,12 @@ jobs: # uses: cypress-io/github-action@v6 # with: # component: true + start: yarn start + wait-on: 'http://web:3000' + - name: Cypress component + uses: cypress-io/github-action@v6 + with: + component: true eslint: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 From c71f9d7170315e6d7c5e4711b10bb44afe8c3802 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 12:22:25 -0600 Subject: [PATCH 10/13] wip: change the wait-on value to use localhost --- .github/workflows/build-test-lint.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 0f2a211..1b85138 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -32,19 +32,8 @@ jobs: - name: Cypress e2e uses: cypress-io/github-action@v6 with: - # cypress: - # runs-on: ubuntu-22.04 - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # - name: Cypress e2e - # uses: cypress-io/github-action@v6 - # - name: Cypress component - # uses: cypress-io/github-action@v6 - # with: - # component: true - start: yarn start - wait-on: 'http://web:3000' + start: next start + wait-on: 'http://localhost:3000' - name: Cypress component uses: cypress-io/github-action@v6 with: From 6977eeb01bb519870fc36b0c4500e919f455c207 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 12:48:50 -0600 Subject: [PATCH 11/13] update the start script --- .github/workflows/build-test-lint.yml | 2 +- Dockerfile | 2 +- package.json | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 1b85138..fcdcca8 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -32,7 +32,7 @@ jobs: - name: Cypress e2e uses: cypress-io/github-action@v6 with: - start: next start + start: yarn start wait-on: 'http://localhost:3000' - name: Cypress component uses: cypress-io/github-action@v6 diff --git a/Dockerfile b/Dockerfile index 734b455..bf12fd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ RUN yarn COPY . /home/node/app RUN yarn build -CMD ["yarn", "start"] +CMD ["yarn", "deploy"] diff --git a/package.json b/package.json index 496ff9f..6054dad 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,14 @@ "scripts": { "dev": "next dev", "build": "next build", - "start": "next build && next start", + "deploy": "next build && next start", + "start": "next start", "lint": "next lint --dir pages --dir utils", "lint:fix": "next lint --dir pages --dir utils --fix", "cypress:open:component": "cypress open --component", - "cypress:open:e2e": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e\"", + "cypress:open:e2e": "start-server-and-test dev http://localhost:3000 \"cypress open\"", "cypress:run:component": "cypress run --component", - "cypress:run:e2e": "start-server-and-test dev http://localhost:3000 \"cypress run --e2e\"", + "cypress:run:e2e": "start-server-and-test dev http://localhost:3000 \"cypress run\"", "jest": "jest", "jest-watch": "jest --watch", "release": "release-it" From cd858c3fc89c7281f6e3790759f5822123f2ca67 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 12:54:16 -0600 Subject: [PATCH 12/13] revert the start script --- Dockerfile | 2 +- package.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf12fd2..734b455 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ RUN yarn COPY . /home/node/app RUN yarn build -CMD ["yarn", "deploy"] +CMD ["yarn", "start"] diff --git a/package.json b/package.json index 6054dad..3e5fe29 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "scripts": { "dev": "next dev", "build": "next build", - "deploy": "next build && next start", - "start": "next start", + "start": "next build && next start", "lint": "next lint --dir pages --dir utils", "lint:fix": "next lint --dir pages --dir utils --fix", "cypress:open:component": "cypress open --component", From d0d5020ba54d25a36912db78544d9aa3fbdae9b4 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Mon, 18 Dec 2023 15:00:52 -0600 Subject: [PATCH 13/13] finalize the cypress commands. --- .github/workflows/build-test-lint.yml | 6 ------ package.json | 12 +++++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index fcdcca8..4ad18a5 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -22,8 +22,6 @@ jobs: with: platforms: 'linux/amd64' webTarget: web - # TODO(alishaevn): figure out how to get the below passing in github actions - # it may be different than our typical setups since we don't use docker locally cypress: runs-on: ubuntu-22.04 steps: @@ -34,10 +32,6 @@ jobs: with: start: yarn start wait-on: 'http://localhost:3000' - - name: Cypress component - uses: cypress-io/github-action@v6 - with: - component: true eslint: needs: build uses: scientist-softserv/actions/.github/workflows/lint.yaml@v0.0.13 diff --git a/package.json b/package.json index 3e5fe29..e628894 100644 --- a/package.json +++ b/package.json @@ -6,18 +6,16 @@ "node": "^18.13.0" }, "scripts": { - "dev": "next dev", "build": "next build", - "start": "next build && next start", + "cypress:e2e": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e --browser electron\"", + "cypress:headless:e2e": "start-server-and-test dev http://localhost:3000 \"cypress run --e2e --browser electron\"", + "dev": "next dev", "lint": "next lint --dir pages --dir utils", "lint:fix": "next lint --dir pages --dir utils --fix", - "cypress:open:component": "cypress open --component", - "cypress:open:e2e": "start-server-and-test dev http://localhost:3000 \"cypress open\"", - "cypress:run:component": "cypress run --component", - "cypress:run:e2e": "start-server-and-test dev http://localhost:3000 \"cypress run\"", "jest": "jest", "jest-watch": "jest --watch", - "release": "release-it" + "release": "release-it", + "start": "next build && next start" }, "dependencies": { "@rjsf/core": "^5.0.0-beta.17",