From 1e49f6b399addc2375cfdbcb194ced72f8f97a5b Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 22:47:40 +0900 Subject: [PATCH 01/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmrc | 1 + owasp/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..cffe8cdef1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +save-exact=true diff --git a/owasp/Dockerfile b/owasp/Dockerfile index b089efe9c8..d412e4e0ab 100644 --- a/owasp/Dockerfile +++ b/owasp/Dockerfile @@ -4,5 +4,5 @@ ENV NODE_ENV production WORKDIR /app COPY ["package.json", "./"] COPY ["public", "public"] -RUN npm install -g serve +RUN npm install -g serve@14.1.2 CMD ["serve", "-s", "-l", "9000", "public"] \ No newline at end of file From e3be5d6157e9fd932cdcc9142d36ac7b4cae6d41 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 23:15:48 +0900 Subject: [PATCH 02/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/src/csp-report.js | 3 +++ owasp/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/src/csp-report.js b/functions/src/csp-report.js index fc47f64a41..53cddedbb7 100644 --- a/functions/src/csp-report.js +++ b/functions/src/csp-report.js @@ -1,9 +1,12 @@ import * as Sentry from "@sentry/node"; import "@sentry/tracing"; +import { ProfilingIntegration } from "@sentry/profiling-node"; Sentry.init({ dsn: "https://aa2f31c272db4f8494e3903a43cc5ca6@o302352.ingest.sentry.io/4504433289986048", tracesSampleRate: 1.0, + integrations: [new ProfilingIntegration()], + profilesSampleRate: 1.0, }); const transaction = Sentry.startTransaction({ diff --git a/owasp/Dockerfile b/owasp/Dockerfile index d412e4e0ab..c06ba794e9 100644 --- a/owasp/Dockerfile +++ b/owasp/Dockerfile @@ -5,4 +5,4 @@ WORKDIR /app COPY ["package.json", "./"] COPY ["public", "public"] RUN npm install -g serve@14.1.2 -CMD ["serve", "-s", "-l", "9000", "public"] \ No newline at end of file +CMD ["serve", "-s", "-l", "9000", "public"] From ce0baaab96451ff17cdef1a5ab9ca3b91fb88616 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 23:39:27 +0900 Subject: [PATCH 03/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 56 +++++++++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 58 insertions(+) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index bc243ce3d1..ecdef306cc 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -149,6 +149,62 @@ jobs: GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} BRANCH_NAME: "screenshot" run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts + test-e2e-chrome: + runs-on: ubuntu-latest + container: cypress/browsers:node16.16.0-chrome107-ff107 + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - uses: denoland/setup-deno@v1 + with: + deno-version: 'v1.x' + - name: install noto font + run: | + sudo apt-get update + sudo apt-get install fonts-noto + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + - name: Cache + uses: actions/cache/restore@v3 + with: + path: | + ~/.cache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + node_modules + key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-build-${{ env.cache-version }}- + - name: yarn install + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: yarn install --frozen-lockfile + - name: Test e2e + env: + GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} + GATSBY_GITHUB_CLIENT_ID: ${{secrets.GATSBY_GITHUB_CLIENT_ID}} + GATSBY_ALGOLIA_SEARCH_API_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_API_KEY}} + GATSBY_ALGOLIA_INDEX_NAME: ${{secrets.GATSBY_ALGOLIA_INDEX_NAME}} + GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}} + GATSBY_ALGOLIA_ADMIN_API_KEY: ${{secrets.GATSBY_ALGOLIA_ADMIN_API_KEY}} + GATSBY_GITHUB_SHA: ${{ github.sha }} + FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} + NETLIFY_ENV: deploy-preview + run: test:e2e:ci:chrome + - name: Get PR Number + id: get-pr-num + run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" + - name: Add file + env: + FILE_PATH: ./cypress/videos/e2e/main.spec.ts.mp4 + FILE_NAME: video-chrome-${{ steps.get-pr-num.outputs.prnum }}-${{ github.head_ref }}-main.spec.ts.mp4 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HEAD_REF: ${{ github.head_ref }} + GITHUB_REPOSITORY: "tubone24/blog" + GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} + BRANCH_NAME: "screenshot" + run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts lint: runs-on: ubuntu-latest steps: diff --git a/package.json b/package.json index c2aba91474..278e19afe3 100644 --- a/package.json +++ b/package.json @@ -110,9 +110,11 @@ "test:storybook": "npm test storybook.test.ts", "cypress:open": "cypress open", "cypress:run": "cypress run", + "cypress:run:chrome": "cypress run --browser chrome", "cypress:base": "cypress run --env type=base --config screenshotsFolder=cypress/snapshots/base,testFiles=\\\"**/*main.spec.ts\\\"", "test:e2e": "start-server-and-test develop:e2e http://localhost:8000 cypress:open", "test:e2e:ci": "start-server-and-test develop:e2e http://localhost:8000 cypress:run", + "test:e2e:ci:chrome": "start-server-and-test develop:e2e http://localhost:8000 cypress:run:chrome", "test:e2e:base": "start-server-and-test develop:e2e http://localhost:8000 cypress:base", "functions": "netlify-lambda serve functions", "clean": "gatsby clean", From 80f1dde08c2d3e2ed5107bf6f61be5b9614a29f6 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 23:42:37 +0900 Subject: [PATCH 04/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index ecdef306cc..e972f9bf8b 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -155,13 +155,13 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 + - name: install noto font and unzip + run: | + sudo apt-get update + sudo apt-get install fonts-noto unzip - uses: denoland/setup-deno@v1 with: deno-version: 'v1.x' - - name: install noto font - run: | - sudo apt-get update - sudo apt-get install fonts-noto - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" From fa65d9ae12a639a89fd8d43c1e9e8dc06504d0c7 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 23:44:03 +0900 Subject: [PATCH 05/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index e972f9bf8b..8b2cc69f22 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -157,8 +157,8 @@ jobs: uses: actions/checkout@v3 - name: install noto font and unzip run: | - sudo apt-get update - sudo apt-get install fonts-noto unzip + apt-get update + apt-get install fonts-noto unzip - uses: denoland/setup-deno@v1 with: deno-version: 'v1.x' From eb56c7401cc2565ed1381005f3c2492e07712975 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 23:46:34 +0900 Subject: [PATCH 06/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 8b2cc69f22..171d576fbf 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -157,8 +157,8 @@ jobs: uses: actions/checkout@v3 - name: install noto font and unzip run: | - apt-get update - apt-get install fonts-noto unzip + apt-get -y update + apt-get -y install fonts-noto unzip - uses: denoland/setup-deno@v1 with: deno-version: 'v1.x' From 656d7578550e41f98899b5781a38be0484d2a61b Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Thu, 19 Jan 2023 23:56:15 +0900 Subject: [PATCH 07/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 171d576fbf..a16436eea5 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -158,7 +158,7 @@ jobs: - name: install noto font and unzip run: | apt-get -y update - apt-get -y install fonts-noto unzip + apt-get -y install fonts-noto unzip build-essential - uses: denoland/setup-deno@v1 with: deno-version: 'v1.x' From 51241ca1a164490b98e9b3c4d6c55ffcb2ad7f09 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:02:31 +0900 Subject: [PATCH 08/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index a16436eea5..353934fa43 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -155,7 +155,7 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 - - name: install noto font and unzip + - name: install apt run: | apt-get -y update apt-get -y install fonts-noto unzip build-essential @@ -172,10 +172,10 @@ jobs: ~/.cache ${{ steps.yarn-cache-dir-path.outputs.dir }} node_modules - key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-chrome-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-build-${{ env.cache-version }}- + ${{ runner.os }}-chrome-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-chrome-build-${{ env.cache-version }}- - name: yarn install env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -191,7 +191,7 @@ jobs: GATSBY_GITHUB_SHA: ${{ github.sha }} FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} NETLIFY_ENV: deploy-preview - run: test:e2e:ci:chrome + run: yarn test:e2e:ci:chrome - name: Get PR Number id: get-pr-num run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" From 4d9b64beb16c97085e634449362387cd5e06a022 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:12:50 +0900 Subject: [PATCH 09/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 353934fa43..fe08abae6b 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -155,6 +155,8 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 + with: + path: /root/blog - name: install apt run: | apt-get -y update @@ -165,6 +167,7 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + working-directory: /root/blog - name: Cache uses: actions/cache/restore@v3 with: @@ -180,6 +183,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: yarn install --frozen-lockfile + working-directory: /root/blog - name: Test e2e env: GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} @@ -192,6 +196,7 @@ jobs: FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} NETLIFY_ENV: deploy-preview run: yarn test:e2e:ci:chrome + working-directory: /root/blog - name: Get PR Number id: get-pr-num run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" From a19d733811600abaf66c551eaaeac1b06e8b391c Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:16:56 +0900 Subject: [PATCH 10/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index fe08abae6b..613b6ca0a8 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -155,8 +155,6 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 - with: - path: /root/blog - name: install apt run: | apt-get -y update @@ -167,7 +165,6 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - working-directory: /root/blog - name: Cache uses: actions/cache/restore@v3 with: @@ -183,7 +180,8 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: yarn install --frozen-lockfile - working-directory: /root/blog + - name: chmod + run: chmod 777 -R /github/home/ - name: Test e2e env: GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} @@ -196,7 +194,6 @@ jobs: FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} NETLIFY_ENV: deploy-preview run: yarn test:e2e:ci:chrome - working-directory: /root/blog - name: Get PR Number id: get-pr-num run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" From 5aa747e64841240fc98586daddbfb0fcdc71de2d Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:23:44 +0900 Subject: [PATCH 11/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 613b6ca0a8..3107ce6908 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -181,7 +181,9 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: yarn install --frozen-lockfile - name: chmod - run: chmod 777 -R /github/home/ + run: | + chmod 777 -R /github/home/ + chmod 777 -R src/ - name: Test e2e env: GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} From 311f80c94b58e28669cdf46e972a302f9b66978f Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:31:09 +0900 Subject: [PATCH 12/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 3107ce6908..72dd7ffd4e 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -184,6 +184,7 @@ jobs: run: | chmod 777 -R /github/home/ chmod 777 -R src/ + chmod 777 -R /__w/blog/blog/ - name: Test e2e env: GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} From 4cf7fd6fbb0e34dc11c78ffc03fc5f31dab676ee Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:46:32 +0900 Subject: [PATCH 13/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 97 +++++++++++++++++++++++++++-- package.json | 2 + 2 files changed, 95 insertions(+), 4 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 72dd7ffd4e..6b4c12df1d 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -48,6 +48,34 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: yarn install --frozen-lockfile + create-cache-e2e: + runs-on: ubuntu-latest + container: cypress/browsers:node-16.18.1-chrome-109.0.5414.74-1-ff-109.0-edge-109.0.1518.52-1 + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.cache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + node_modules + key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-build-${{ env.cache-version }}- + - name: yarn install + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: yarn install --frozen-lockfile test: runs-on: ubuntu-latest steps: @@ -151,7 +179,7 @@ jobs: run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts test-e2e-chrome: runs-on: ubuntu-latest - container: cypress/browsers:node16.16.0-chrome107-ff107 + container: cypress/browsers:node-16.18.1-chrome-109.0.5414.74-1-ff-109.0-edge-109.0.1518.52-1 steps: - name: Checkout source code uses: actions/checkout@v3 @@ -172,10 +200,10 @@ jobs: ~/.cache ${{ steps.yarn-cache-dir-path.outputs.dir }} node_modules - key: ${{ runner.os }}-chrome-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-chrome-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-chrome-build-${{ env.cache-version }}- + ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-e2e-build-${{ env.cache-version }}- - name: yarn install env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -210,6 +238,67 @@ jobs: GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} BRANCH_NAME: "screenshot" run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts + test-e2e-firefox: + runs-on: ubuntu-latest + container: cypress/browsers:node-16.18.1-chrome-109.0.5414.74-1-ff-109.0-edge-109.0.1518.52-1 + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: install apt + run: | + apt-get -y update + apt-get -y install fonts-noto unzip build-essential + - uses: denoland/setup-deno@v1 + with: + deno-version: 'v1.x' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + - name: Cache + uses: actions/cache/restore@v3 + with: + path: | + ~/.cache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + node_modules + key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-e2e-build-${{ env.cache-version }}- + - name: yarn install + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: yarn install --frozen-lockfile + - name: chmod + run: | + chmod 777 -R /github/home/ + chmod 777 -R src/ + chmod 777 -R /__w/blog/blog/ + - name: Test e2e + env: + GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} + GATSBY_GITHUB_CLIENT_ID: ${{secrets.GATSBY_GITHUB_CLIENT_ID}} + GATSBY_ALGOLIA_SEARCH_API_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_API_KEY}} + GATSBY_ALGOLIA_INDEX_NAME: ${{secrets.GATSBY_ALGOLIA_INDEX_NAME}} + GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}} + GATSBY_ALGOLIA_ADMIN_API_KEY: ${{secrets.GATSBY_ALGOLIA_ADMIN_API_KEY}} + GATSBY_GITHUB_SHA: ${{ github.sha }} + FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} + NETLIFY_ENV: deploy-preview + run: yarn test:e2e:ci:firefox + - name: Get PR Number + id: get-pr-num + run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" + - name: Add file + env: + FILE_PATH: ./cypress/videos/e2e/main.spec.ts.mp4 + FILE_NAME: video-firefox-${{ steps.get-pr-num.outputs.prnum }}-${{ github.head_ref }}-main.spec.ts.mp4 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HEAD_REF: ${{ github.head_ref }} + GITHUB_REPOSITORY: "tubone24/blog" + GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} + BRANCH_NAME: "screenshot" + run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts lint: runs-on: ubuntu-latest steps: diff --git a/package.json b/package.json index 278e19afe3..552a480037 100644 --- a/package.json +++ b/package.json @@ -111,10 +111,12 @@ "cypress:open": "cypress open", "cypress:run": "cypress run", "cypress:run:chrome": "cypress run --browser chrome", + "cypress:run:firefox": "cypress run --browser firefox", "cypress:base": "cypress run --env type=base --config screenshotsFolder=cypress/snapshots/base,testFiles=\\\"**/*main.spec.ts\\\"", "test:e2e": "start-server-and-test develop:e2e http://localhost:8000 cypress:open", "test:e2e:ci": "start-server-and-test develop:e2e http://localhost:8000 cypress:run", "test:e2e:ci:chrome": "start-server-and-test develop:e2e http://localhost:8000 cypress:run:chrome", + "test:e2e:ci:firefox": "start-server-and-test develop:e2e http://localhost:8000 cypress:run:firefox", "test:e2e:base": "start-server-and-test develop:e2e http://localhost:8000 cypress:base", "functions": "netlify-lambda serve functions", "clean": "gatsby clean", From 1a0b9ac948a9255721c659c8b813188b23002bce Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 00:55:55 +0900 Subject: [PATCH 14/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 6b4c12df1d..69a9930067 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -213,6 +213,7 @@ jobs: chmod 777 -R /github/home/ chmod 777 -R src/ chmod 777 -R /__w/blog/blog/ + chmod 777 -R /root/ - name: Test e2e env: GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} @@ -274,6 +275,7 @@ jobs: chmod 777 -R /github/home/ chmod 777 -R src/ chmod 777 -R /__w/blog/blog/ + chmod 777 -R /root/ - name: Test e2e env: GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} From 12116013546f7c32dbe3e8ef41a7debebfd2584e Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 01:09:16 +0900 Subject: [PATCH 15/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 69a9930067..50d9befca6 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -61,17 +61,6 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cache - ${{ steps.yarn-cache-dir-path.outputs.dir }} - node_modules - key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-build-${{ env.cache-version }}- - name: yarn install env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -255,17 +244,6 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - - name: Cache - uses: actions/cache/restore@v3 - with: - path: | - ~/.cache - ${{ steps.yarn-cache-dir-path.outputs.dir }} - node_modules - key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-e2e-build-${{ env.cache-version }}- - name: yarn install env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 8a0beecf99a114cc3b2bd943774b73e04968b480 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 01:27:08 +0900 Subject: [PATCH 16/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 50d9befca6..87eb434bdd 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -50,7 +50,7 @@ jobs: run: yarn install --frozen-lockfile create-cache-e2e: runs-on: ubuntu-latest - container: cypress/browsers:node-16.18.1-chrome-109.0.5414.74-1-ff-109.0-edge-109.0.1518.52-1 + container: cypress/browsers:node16.18.0-chrome107-ff106-edge steps: - name: Checkout source code uses: actions/checkout@v3 @@ -61,6 +61,17 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.cache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + node_modules + key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-build-${{ env.cache-version }}- - name: yarn install env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -168,7 +179,7 @@ jobs: run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts test-e2e-chrome: runs-on: ubuntu-latest - container: cypress/browsers:node-16.18.1-chrome-109.0.5414.74-1-ff-109.0-edge-109.0.1518.52-1 + container: cypress/browsers:node16.18.0-chrome107-ff106-edge steps: - name: Checkout source code uses: actions/checkout@v3 @@ -230,7 +241,7 @@ jobs: run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts test-e2e-firefox: runs-on: ubuntu-latest - container: cypress/browsers:node-16.18.1-chrome-109.0.5414.74-1-ff-109.0-edge-109.0.1518.52-1 + container: cypress/browsers:node16.18.0-chrome107-ff106-edge steps: - name: Checkout source code uses: actions/checkout@v3 @@ -244,6 +255,17 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + - name: Cache + uses: actions/cache/restore@v3 + with: + path: | + ~/.cache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + node_modules + key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-e2e-build-${{ env.cache-version }}- - name: yarn install env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 7888b5480e250ba5cbe80e505bfa646507921753 Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 01:42:52 +0900 Subject: [PATCH 17/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 87eb434bdd..1139f03d5b 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -50,7 +50,7 @@ jobs: run: yarn install --frozen-lockfile create-cache-e2e: runs-on: ubuntu-latest - container: cypress/browsers:node16.18.0-chrome107-ff106-edge + container: node16.16.0-chrome107-ff107 steps: - name: Checkout source code uses: actions/checkout@v3 @@ -179,7 +179,7 @@ jobs: run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts test-e2e-chrome: runs-on: ubuntu-latest - container: cypress/browsers:node16.18.0-chrome107-ff106-edge + container: node16.16.0-chrome107-ff107 steps: - name: Checkout source code uses: actions/checkout@v3 @@ -241,7 +241,7 @@ jobs: run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts test-e2e-firefox: runs-on: ubuntu-latest - container: cypress/browsers:node16.18.0-chrome107-ff106-edge + container: node16.16.0-chrome107-ff107 steps: - name: Checkout source code uses: actions/checkout@v3 From 00942de43b77d0438dd88fd49aae79bb8d34da3a Mon Sep 17 00:00:00 2001 From: "yu.otsubo" Date: Fri, 20 Jan 2023 01:44:32 +0900 Subject: [PATCH 18/18] =?UTF-8?q?[skip=20netlify]version=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/previewDeploy.yml | 304 ++++++++++++++-------------- 1 file changed, 152 insertions(+), 152 deletions(-) diff --git a/.github/workflows/previewDeploy.yml b/.github/workflows/previewDeploy.yml index 1139f03d5b..f8884eb2d6 100644 --- a/.github/workflows/previewDeploy.yml +++ b/.github/workflows/previewDeploy.yml @@ -48,34 +48,34 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: yarn install --frozen-lockfile - create-cache-e2e: - runs-on: ubuntu-latest - container: node16.16.0-chrome107-ff107 - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cache - ${{ steps.yarn-cache-dir-path.outputs.dir }} - node_modules - key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-build-${{ env.cache-version }}- - - name: yarn install - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: yarn install --frozen-lockfile +# create-cache-e2e: +# runs-on: ubuntu-latest +# container: cypress/browsers:node16.18.0-chrome107-ff106-edge +# steps: +# - name: Checkout source code +# uses: actions/checkout@v3 +# - name: Setup Node +# uses: actions/setup-node@v3 +# with: +# node-version: 16.x +# - name: Get yarn cache directory path +# id: yarn-cache-dir-path +# run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" +# - name: Cache +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cache +# ${{ steps.yarn-cache-dir-path.outputs.dir }} +# node_modules +# key: ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} +# ${{ runner.os }}-build-${{ env.cache-version }}- +# - name: yarn install +# env: +# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} +# run: yarn install --frozen-lockfile test: runs-on: ubuntu-latest steps: @@ -177,130 +177,130 @@ jobs: GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} BRANCH_NAME: "screenshot" run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts - test-e2e-chrome: - runs-on: ubuntu-latest - container: node16.16.0-chrome107-ff107 - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - name: install apt - run: | - apt-get -y update - apt-get -y install fonts-noto unzip build-essential - - uses: denoland/setup-deno@v1 - with: - deno-version: 'v1.x' - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - - name: Cache - uses: actions/cache/restore@v3 - with: - path: | - ~/.cache - ${{ steps.yarn-cache-dir-path.outputs.dir }} - node_modules - key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-e2e-build-${{ env.cache-version }}- - - name: yarn install - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: yarn install --frozen-lockfile - - name: chmod - run: | - chmod 777 -R /github/home/ - chmod 777 -R src/ - chmod 777 -R /__w/blog/blog/ - chmod 777 -R /root/ - - name: Test e2e - env: - GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} - GATSBY_GITHUB_CLIENT_ID: ${{secrets.GATSBY_GITHUB_CLIENT_ID}} - GATSBY_ALGOLIA_SEARCH_API_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_API_KEY}} - GATSBY_ALGOLIA_INDEX_NAME: ${{secrets.GATSBY_ALGOLIA_INDEX_NAME}} - GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}} - GATSBY_ALGOLIA_ADMIN_API_KEY: ${{secrets.GATSBY_ALGOLIA_ADMIN_API_KEY}} - GATSBY_GITHUB_SHA: ${{ github.sha }} - FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} - NETLIFY_ENV: deploy-preview - run: yarn test:e2e:ci:chrome - - name: Get PR Number - id: get-pr-num - run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" - - name: Add file - env: - FILE_PATH: ./cypress/videos/e2e/main.spec.ts.mp4 - FILE_NAME: video-chrome-${{ steps.get-pr-num.outputs.prnum }}-${{ github.head_ref }}-main.spec.ts.mp4 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HEAD_REF: ${{ github.head_ref }} - GITHUB_REPOSITORY: "tubone24/blog" - GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} - BRANCH_NAME: "screenshot" - run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts - test-e2e-firefox: - runs-on: ubuntu-latest - container: node16.16.0-chrome107-ff107 - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - name: install apt - run: | - apt-get -y update - apt-get -y install fonts-noto unzip build-essential - - uses: denoland/setup-deno@v1 - with: - deno-version: 'v1.x' - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - - name: Cache - uses: actions/cache/restore@v3 - with: - path: | - ~/.cache - ${{ steps.yarn-cache-dir-path.outputs.dir }} - node_modules - key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} - ${{ runner.os }}-e2e-build-${{ env.cache-version }}- - - name: yarn install - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: yarn install --frozen-lockfile - - name: chmod - run: | - chmod 777 -R /github/home/ - chmod 777 -R src/ - chmod 777 -R /__w/blog/blog/ - chmod 777 -R /root/ - - name: Test e2e - env: - GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} - GATSBY_GITHUB_CLIENT_ID: ${{secrets.GATSBY_GITHUB_CLIENT_ID}} - GATSBY_ALGOLIA_SEARCH_API_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_API_KEY}} - GATSBY_ALGOLIA_INDEX_NAME: ${{secrets.GATSBY_ALGOLIA_INDEX_NAME}} - GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}} - GATSBY_ALGOLIA_ADMIN_API_KEY: ${{secrets.GATSBY_ALGOLIA_ADMIN_API_KEY}} - GATSBY_GITHUB_SHA: ${{ github.sha }} - FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} - NETLIFY_ENV: deploy-preview - run: yarn test:e2e:ci:firefox - - name: Get PR Number - id: get-pr-num - run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" - - name: Add file - env: - FILE_PATH: ./cypress/videos/e2e/main.spec.ts.mp4 - FILE_NAME: video-firefox-${{ steps.get-pr-num.outputs.prnum }}-${{ github.head_ref }}-main.spec.ts.mp4 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HEAD_REF: ${{ github.head_ref }} - GITHUB_REPOSITORY: "tubone24/blog" - GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} - BRANCH_NAME: "screenshot" - run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts +# test-e2e-chrome: +# runs-on: ubuntu-latest +# container: cypress/browsers:node16.18.0-chrome107-ff106-edge +# steps: +# - name: Checkout source code +# uses: actions/checkout@v3 +# - name: install apt +# run: | +# apt-get -y update +# apt-get -y install fonts-noto unzip build-essential +# - uses: denoland/setup-deno@v1 +# with: +# deno-version: 'v1.x' +# - name: Get yarn cache directory path +# id: yarn-cache-dir-path +# run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" +# - name: Cache +# uses: actions/cache/restore@v3 +# with: +# path: | +# ~/.cache +# ${{ steps.yarn-cache-dir-path.outputs.dir }} +# node_modules +# key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} +# ${{ runner.os }}-e2e-build-${{ env.cache-version }}- +# - name: yarn install +# env: +# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} +# run: yarn install --frozen-lockfile +# - name: chmod +# run: | +# chmod 777 -R /github/home/ +# chmod 777 -R src/ +# chmod 777 -R /__w/blog/blog/ +# chmod 777 -R /root/ +# - name: Test e2e +# env: +# GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} +# GATSBY_GITHUB_CLIENT_ID: ${{secrets.GATSBY_GITHUB_CLIENT_ID}} +# GATSBY_ALGOLIA_SEARCH_API_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_API_KEY}} +# GATSBY_ALGOLIA_INDEX_NAME: ${{secrets.GATSBY_ALGOLIA_INDEX_NAME}} +# GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}} +# GATSBY_ALGOLIA_ADMIN_API_KEY: ${{secrets.GATSBY_ALGOLIA_ADMIN_API_KEY}} +# GATSBY_GITHUB_SHA: ${{ github.sha }} +# FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} +# NETLIFY_ENV: deploy-preview +# run: yarn test:e2e:ci:chrome +# - name: Get PR Number +# id: get-pr-num +# run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" +# - name: Add file +# env: +# FILE_PATH: ./cypress/videos/e2e/main.spec.ts.mp4 +# FILE_NAME: video-chrome-${{ steps.get-pr-num.outputs.prnum }}-${{ github.head_ref }}-main.spec.ts.mp4 +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# HEAD_REF: ${{ github.head_ref }} +# GITHUB_REPOSITORY: "tubone24/blog" +# GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} +# BRANCH_NAME: "screenshot" +# run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts +# test-e2e-firefox: +# runs-on: ubuntu-latest +# container: cypress/browsers:node16.18.0-chrome107-ff106-edge +# steps: +# - name: Checkout source code +# uses: actions/checkout@v3 +# - name: install apt +# run: | +# apt-get -y update +# apt-get -y install fonts-noto unzip build-essential +# - uses: denoland/setup-deno@v1 +# with: +# deno-version: 'v1.x' +# - name: Get yarn cache directory path +# id: yarn-cache-dir-path +# run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" +# - name: Cache +# uses: actions/cache/restore@v3 +# with: +# path: | +# ~/.cache +# ${{ steps.yarn-cache-dir-path.outputs.dir }} +# node_modules +# key: ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-e2e-build-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }} +# ${{ runner.os }}-e2e-build-${{ env.cache-version }}- +# - name: yarn install +# env: +# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} +# run: yarn install --frozen-lockfile +# - name: chmod +# run: | +# chmod 777 -R /github/home/ +# chmod 777 -R src/ +# chmod 777 -R /__w/blog/blog/ +# chmod 777 -R /root/ +# - name: Test e2e +# env: +# GATSBY_GITHUB_CLIENT_SECRET: ${{secrets.GATSBY_GITHUB_CLIENT_SECRET}} +# GATSBY_GITHUB_CLIENT_ID: ${{secrets.GATSBY_GITHUB_CLIENT_ID}} +# GATSBY_ALGOLIA_SEARCH_API_KEY: ${{secrets.GATSBY_ALGOLIA_SEARCH_API_KEY}} +# GATSBY_ALGOLIA_INDEX_NAME: ${{secrets.GATSBY_ALGOLIA_INDEX_NAME}} +# GATSBY_ALGOLIA_APP_ID: ${{secrets.GATSBY_ALGOLIA_APP_ID}} +# GATSBY_ALGOLIA_ADMIN_API_KEY: ${{secrets.GATSBY_ALGOLIA_ADMIN_API_KEY}} +# GATSBY_GITHUB_SHA: ${{ github.sha }} +# FAUNADB_SERVER_SECRET: ${{secrets.FAUNADB_SERVER_SECRET}} +# NETLIFY_ENV: deploy-preview +# run: yarn test:e2e:ci:firefox +# - name: Get PR Number +# id: get-pr-num +# run: echo "prnum=$(echo "${GITHUB_REF}" | sed -e 's/[^0-9]//g')" >> "${GITHUB_OUTPUT}" +# - name: Add file +# env: +# FILE_PATH: ./cypress/videos/e2e/main.spec.ts.mp4 +# FILE_NAME: video-firefox-${{ steps.get-pr-num.outputs.prnum }}-${{ github.head_ref }}-main.spec.ts.mp4 +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# HEAD_REF: ${{ github.head_ref }} +# GITHUB_REPOSITORY: "tubone24/blog" +# GITHUB_PULL_REQUEST_NUMBER: ${{ steps.get-pr-num.outputs.prnum }} +# BRANCH_NAME: "screenshot" +# run: deno run --allow-env --allow-read --allow-net scripts/uploadScreenShot.ts lint: runs-on: ubuntu-latest steps: