added badges

This commit is contained in:
Murat Ozcan 2022-05-04 11:20:47 -05:00
parent cd462f0bed
commit 4e84ee13da
5 changed files with 123 additions and 64 deletions

38
.github/workflows/badges.yml vendored Normal file
View File

@ -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

View File

@ -10,74 +10,74 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
# Version 1: no parallelization # Version 1: no parallelization
# - name: Cypress run - name: Cypress run
# uses: cypress-io/github-action@v3.0.4 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
with: with:
browser: chrome browser: chrome
start: yarn dev start: yarn dev
wait-on: 'http://localhost:3000' wait-on: 'http://localhost:3000'
wait-on-timeout: 120000 wait-on-timeout: 120000
record: true record: true
# spec: cypress/integration/*
env: 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 }} 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 }} 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 }}

View File

@ -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) [![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 # 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. 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.

11
renovate.json Normal file
View File

@ -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
}

View File

@ -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 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.