From 56b7fab874f1044a227b6b870f0ae1ff619afd35 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Sun, 10 Oct 2021 15:08:17 +0900 Subject: [PATCH 1/5] [Feature] Github Actions workflows CI - Add Github Actions workflows CI (Lint, unit, e2e test) --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ package.json | 5 +++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dfbec6e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + pull_request: + branches: [main] + +jobs: + continuous-integration: + 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: Check Unit Test + run: yarn test:unit + + - name: Check Lint + run: yarn lint + + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + install: false + command: yarn test:e2e diff --git a/package.json b/package.json index ca673eb..6a6e2aa 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "test": "react-scripts test", - "test:coverage": "yarn test --watchAll=false --coverage", + "lint": "eslint --ext ts,tsx .", + "test:unit": "react-scripts test", + "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", From 80b60157a2f25078db8d68ae0e0008465f4f5b77 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Sun, 10 Oct 2021 15:12:28 +0900 Subject: [PATCH 2/5] Check CI e2e test pipline --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfbec6e..41851c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,17 @@ jobs: - name: Install dependencies run: yarn install --immutable --immutable-cache - - name: Check Unit Test - run: yarn test:unit - - name: Check Lint run: yarn lint + - name: Check Unit Test + run: yarn test:unit + - name: Cypress run uses: cypress-io/github-action@v2 with: install: false - command: yarn test:e2e + start: yarn start + wait-on: 'http://localhost:3000' + browser: chrome + headless: true From b8fa867218be916f78cd1e3b3d1d7fc1ef445c5a Mon Sep 17 00:00:00 2001 From: saseungmin Date: Sun, 10 Oct 2021 15:15:23 +0900 Subject: [PATCH 3/5] [Fix] CI e2e test Command --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41851c0..d1e181c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,13 +21,11 @@ jobs: run: yarn lint - name: Check Unit Test - run: yarn test:unit + run: yarn test:coverage - name: Cypress run uses: cypress-io/github-action@v2 with: install: false - start: yarn start - wait-on: 'http://localhost:3000' + command: yarn test:e2e browser: chrome - headless: true From 006af20052ac57470bedd93acc2f47b728a84a01 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Sun, 10 Oct 2021 15:17:44 +0900 Subject: [PATCH 4/5] [Remove] Cypress CI brower command --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1e181c..a203805 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,4 +28,3 @@ jobs: with: install: false command: yarn test:e2e - browser: chrome From 716e99087187504908e391beb8c5366e44a954b1 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Sun, 10 Oct 2021 15:36:54 +0900 Subject: [PATCH 5/5] [Fix] CI e2e naming - Cypress run to Check e2e test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a203805..b46ae4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Check Unit Test run: yarn test:coverage - - name: Cypress run + - name: Check e2e Test uses: cypress-io/github-action@v2 with: install: false