From 4e84ee13da63e7018b8d8e2d9b5197b993c4fb0c Mon Sep 17 00:00:00 2001 From: Murat Ozcan Date: Wed, 4 May 2022 11:20:47 -0500 Subject: [PATCH] added badges --- .github/workflows/badges.yml | 38 +++++++++++ .github/workflows/main.yml | 124 +++++++++++++++++------------------ README.md | 9 +++ renovate.json | 11 ++++ site/comments.md | 5 +- 5 files changed, 123 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/badges.yml create mode 100644 renovate.json diff --git a/.github/workflows/badges.yml b/.github/workflows/badges.yml new file mode 100644 index 000000000..9acae5a7d --- /dev/null +++ b/.github/workflows/badges.yml @@ -0,0 +1,38 @@ +name: badges +on: + push: + # update README badge only if the README file changes + # or if the package.json file changes, or this file changes + branches: + - main + paths: + - README.md + - package.json + - .github/workflows/badges.yml + schedule: + # update badges every night + # because we have a few badges that are linked + # to the external repositories + - cron: '0 3 * * *' + + workflow_dispatch: + +jobs: + badges: + name: Badges + runs-on: ubuntu-20.04 + steps: + - name: Checkout 🛎 + uses: actions/checkout@v3 + + - name: Update version badges 🏷 + run: npx -p dependency-version-badge update-badge cypress + + - name: Commit any changed files 💾 + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Updated badges + branch: main + file_pattern: README.md + push_options: '--force' + skip_fetch: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e88b9fa0..84d48a5b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,74 +10,74 @@ jobs: uses: actions/checkout@v2 # Version 1: no parallelization - # - name: Cypress run - # uses: cypress-io/github-action@v3.0.4 - # with: - # browser: chrome - # start: yarn dev - # wait-on: 'http://localhost:3000' - # wait-on-timeout: 120000 - # record: true - # env: - # COMMERCE_PROVIDER: ${{ secrets.COMMERCE_PROVIDER }} - # NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN }} - # NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN }} - # NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED: true - # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # # pass GitHub token to allow accurately detecting a build vs a re-run build - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - ############################################################################################################################# - - # Version 2: install in one job, parallelize the e2e jobs - - name: Cypress install - uses: cypress-io/github-action@v2 - with: - runTests: false - - # probably Vercel relevant. No idea why we have to build anything - # In version 1, I did not have to build anything to get things to work in CI - # here, without the build job generating an artifact, the test jobs do not really get items related to our store - - run: yarn build - env: - COMMERCE_PROVIDER: ${{ secrets.COMMERCE_PROVIDER }} - NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN }} - NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN }} - - - name: Save build folder - uses: actions/upload-artifact@v2 - with: - name: build - if-no-files-found: error - path: ./packages/**/dist/** - - ui-chrome-tests: - runs-on: ubuntu-latest - needs: install - strategy: - fail-fast: false - matrix: - containers: [1, 2] - steps: - - name: Checkout - uses: actions/checkout@v2 - - # must be Vercel relevant. No idea why we have to build anything - - name: Download the build folders - uses: actions/download-artifact@v2 - with: - name: build - path: ./packages/**/dist/** - - - name: 'Chrome E2E Tests' - uses: cypress-io/github-action@v2 + - name: Cypress run + uses: cypress-io/github-action@v3.0.4 with: browser: chrome start: yarn dev wait-on: 'http://localhost:3000' wait-on-timeout: 120000 record: true - # spec: cypress/integration/* env: + COMMERCE_PROVIDER: ${{ secrets.COMMERCE_PROVIDER }} + NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN }} + NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN }} + NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED: true CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # pass GitHub token to allow accurately detecting a build vs a re-run build GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + ############################################################################################################################# + + # # Version 2: install in one job, parallelize the e2e jobs + # - name: Cypress install + # uses: cypress-io/github-action@v2 + # with: + # runTests: false + + # # probably Vercel relevant. No idea why we have to build anything + # # In version 1, I did not have to build anything to get things to work in CI + # # here, without the build job generating an artifact, the test jobs do not really get items related to our store + # - run: yarn build + # env: + # COMMERCE_PROVIDER: ${{ secrets.COMMERCE_PROVIDER }} + # NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN }} + # NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN }} + + # - name: Save build folder + # uses: actions/upload-artifact@v2 + # with: + # name: build + # if-no-files-found: error + # path: ./packages/**/dist/** + + # ui-chrome-tests: + # runs-on: ubuntu-latest + # needs: install + # strategy: + # fail-fast: false + # matrix: + # containers: [1, 2] + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + + # # must be Vercel relevant. No idea why we have to build anything + # - name: Download the build folders + # uses: actions/download-artifact@v2 + # with: + # name: build + # path: ./packages/**/dist/** + + # - name: 'Chrome E2E Tests' + # uses: cypress-io/github-action@v2 + # with: + # browser: chrome + # start: yarn dev + # wait-on: 'http://localhost:3000' + # wait-on-timeout: 120000 + # record: true + # # spec: cypress/integration/* + # env: + # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index fe0700030..fc014e48a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerce&project-name=commerce&repo-name=commerce&demo-title=Next.js%20Commerce&demo-description=An%20all-in-one%20starter%20kit%20for%20high-performance%20e-commerce%20sites.&demo-url=https%3A%2F%2Fdemo.vercel.store&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&integration-ids=oac_MuWZiE4jtmQ2ejZQaQ7ncuDT,oac_9HSKtXld74NG0srzdxSiBGty&skippable-integrations=1&root-directory=site&build-command=cd%20..%20%26%26%20yarn%20build) +![cypress version](https://img.shields.io/badge/cypress-9.6.0-brightgreen) + +[![E2E on Chrome](https://github.com/muratkeremozcan/nextjs-cypress/actions/workflows/main.yml/badge.svg?branch=main&event=push)](https://github.com/muratkeremozcan/nextjs-cypress/actions/workflows/main.yml) + +[![Cypress with Next.js and Shopify Store Tutorial](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/detailed/pefcjb&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/pefcjb/runs) + +[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg +[renovate-app]: https://renovateapp.com/ + # Next.js Commerce The all-in-one starter kit for high-performance e-commerce sites. With a few clicks, Next.js developers can clone, deploy and fully customize their own store. diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..a29dbfab5 --- /dev/null +++ b/renovate.json @@ -0,0 +1,11 @@ +{ + "extends": ["config:base"], + "automerge": true, + "prHourlyLimit": 2, + "updateNotScheduled": false, + "timezone": "America/New_York", + "schedule": ["after 10pm and before 5am on every weekday", "every weekend"], + "masterIssue": true, + "labels": ["type: dependencies", "renovate"], + "dependencyDashboardApproval": false +} diff --git a/site/comments.md b/site/comments.md index 540a9ef3a..e935c1329 100644 --- a/site/comments.md +++ b/site/comments.md @@ -428,7 +428,8 @@ Unsure about any of the `build` instructions. The yml at the end of Part 5 does https://github.com/muratkeremozcan/nextjs-cypress/runs/6292547384?check_suite_focus=true -Instead of `path: build` in the yml, used `path: ./packages/**/dist/**` . This got things to work. However parallel e2e tests did not start in 18 minutes. This yml cannot be optimal +Instead of `path: build` in the yml, used `path: ./packages/**/dist/**` . This got things to work. However parallel e2e tests did not start in 18 minutes. https://github.com/muratkeremozcan/nextjs-cypress/runs/6292906819?check_suite_focus=true -https://github.com/muratkeremozcan/nextjs-cypress/runs/6292906819?check_suite_focus=true +The 2nd attempt seemed natural, but acted as if we left out the build CRUD work altogether https://dashboard.cypress.io/projects/pefcjb/runs/31c1fa51-d767-4b32-bfc6-d7999e6d8bfb/test-results/30a2947c-80ab-477a-adf5-84d420f596eb/screenshots. +I have disabled the parallelization as advertised for the time being. Perhaps there are gotchas with Vercel that need to be figured out.