From cd76c6e8d698d331e86994aeef63ccca21ff53e2 Mon Sep 17 00:00:00 2001 From: wooBottle Date: Thu, 30 Nov 2023 23:31:06 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:bricks:=20Git=20workflow=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 추가했지롱 --- .github/workflows/archive-stable-version.yml | 39 ++++++++++++++++ .github/workflows/check-if-mergeable.yml | 47 ++++++++++++++++++++ package.json | 3 +- 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/archive-stable-version.yml create mode 100644 .github/workflows/check-if-mergeable.yml diff --git a/.github/workflows/archive-stable-version.yml b/.github/workflows/archive-stable-version.yml new file mode 100644 index 00000000..6e6acd11 --- /dev/null +++ b/.github/workflows/archive-stable-version.yml @@ -0,0 +1,39 @@ +name: Archive Stable Version + +on: + workflow_dispatch: + schedule: + - cron: 0 19 * * * + +jobs: + archiveStableVersion: + runs-on: ubuntu-latest + steps: + - name: Create Pull Request + id: cpr + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + result-encoding: string + script: | + try { + const result = await github.rest.pulls.create({ + owner: context.repo.owner, + repo: context.repo.repo, + labels: 'automerge', + title: '[auto-created] Daily up-to-date main branch', + head: 'release', + base: 'main', + }); + const mergeResult = await github.rest.pulls.merge({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: result.data.number, + merge_method: 'merge', + }) + } catch (error) { + core.setFailed('Action failed') + if (error?.message != 'No commits between master and release') { + return 'hasError' + } + } diff --git a/.github/workflows/check-if-mergeable.yml b/.github/workflows/check-if-mergeable.yml new file mode 100644 index 00000000..f5051ed9 --- /dev/null +++ b/.github/workflows/check-if-mergeable.yml @@ -0,0 +1,47 @@ +name: check-if-mergeable + +on: + pull_request: + types: + - opened + - synchronize + branches: + - 'develop' + +jobs: + build: + name: check-if-mergeable + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2.3.4 + + # node 세팅 + - name: Init node + uses: actions/setup-node@v2.4.1 + with: + node-version: '18.17.1' + cache: 'yarn' + + - name: Set Yarn Version + id: set-version + run: | + yarn set version 4.0.2 + echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT + + - name: Yarn Cache - PnP + uses: actions/cache@v2 + with: + path: | + .yarn/cache + .pnp.* + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }} + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}- + + - name: Install dependencies + run: yarn install + + - name: check-unit-test + run: yarn test ./src diff --git a/package.json b/package.json index df9fd913..798e9ab6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint:fix": "next lint --fix", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", - "test": "jest --watch", + "test": "jest", + "test:watch": "jest --watch", "test:ci": "jest --ci", "test:coverage": "jest --coverage" }, From 8e8525a23dfbdc13219624f38e0c3f416ee77a15 Mon Sep 17 00:00:00 2001 From: wooBottle Date: Thu, 30 Nov 2023 23:36:33 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:bug:=20Pr=20=EC=8B=A4=ED=8C=A8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 추가했지롱 --- src/services/index.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/services/index.spec.ts diff --git a/src/services/index.spec.ts b/src/services/index.spec.ts new file mode 100644 index 00000000..8876c276 --- /dev/null +++ b/src/services/index.spec.ts @@ -0,0 +1,6 @@ +// pr 머지용 임시 테스트 코드 +describe('test', () => { + test('test', () => { + expect(1).toBe(1); + }); +}); From 8ca3a8a1a48a616c7942583d275c2e62335a339b Mon Sep 17 00:00:00 2001 From: wooBottle Date: Thu, 30 Nov 2023 23:43:34 +0900 Subject: [PATCH 3/3] =?UTF-8?q?:zap:=20Nvmrc=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 추가했는데 --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..b6fb44b8 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18.17.1 \ No newline at end of file