From d3cb82158c2dd4a97fbe67ef41b0dbf963e4d8e1 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Mon, 11 Oct 2021 20:11:26 +0900 Subject: [PATCH 1/3] [Add] codecov.yml - set code coverage in codecov --- .github/workflows/codecov.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..62da1f4 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,24 @@ +name: Codecov Coverage + +on: [push] + +jobs: + set-codecov-test-coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - name: Install dependencies + run: yarn install --immutable --immutable-cache + + - name: Create Unit Test Coverage + run: yarn test:coverage + + - name: Set unit test coverage + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true From df6c32ffaa3fc0779e0cb1995924c61bae6293a1 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Mon, 11 Oct 2021 20:24:25 +0900 Subject: [PATCH 2/3] [Add] Codecov record - Set Codecov record dashboard --- .github/workflows/ci.yml | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b46ae4e..ec44611 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,6 @@ jobs: with: install: false command: yarn test:e2e + env: + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} diff --git a/package.json b/package.json index ff82385..0ecb7ce 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test:coverage": "yarn test:unit --watchAll=false --coverage", "cypress:open": "cypress open", "cypress:run": "cypress run", - "test:e2e": "start-server-and-test start http://localhost:3000 cypress:run", + "cypress:record": "yarn cypress:run --browser chrome --record", + "test:e2e": "start-server-and-test start http://localhost:3000 cypress:record", "eject": "react-scripts eject" }, "jest": { From 3b54ff8e3865a63479ca9fd239cdf0cd59dada80 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Mon, 11 Oct 2021 21:02:11 +0900 Subject: [PATCH 3/3] [Update] README.md - Add badge --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97164c1..ade288f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# yarn-berry-example -Yarn berry example with react + typescript + cypress + jest + github actions CI +# ๐Ÿงถ Yarn berry Example + +[![codecov](https://codecov.io/gh/saseungmin/yarn-berry-example/branch/main/graph/badge.svg?token=QWA2HOE10W)](https://codecov.io/gh/saseungmin/yarn-berry-example) [![yarn-berry-example](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/g1oxx9&style=flat-square&logo=cypress)](https://dashboard.cypress.io/projects/g1oxx9/runs) +![yarn](https://img.shields.io/badge/yarn-3.0.2-blue) ![react](https://img.shields.io/badge/react-^17.0.2-blue) ![typescript](https://img.shields.io/badge/typescript-^4.4.3-blue) ![jest](https://img.shields.io/badge/jest-^27.1.0-blue) ![cypress](https://img.shields.io/badge/cypress-^8.5.0-blue) ![eslint](https://img.shields.io/badge/eslint-^7.32.0-blue) + +#### ๐Ÿ‘‰ Yarn berry example using React + TypeScript + Jest + Cypress + Eslint + Github Actions CI/CD + Github Pages + +#### ๐Ÿ‘‰ Please refer to the [blog](https://haranglog.tistory.com/28) for an explanation of this repository example.