From 316a2d1fc41d48f8137837d46212941e95bd9f9f Mon Sep 17 00:00:00 2001 From: Jungu Lee <1zzangjun@gmail.com> Date: Sat, 4 Nov 2023 03:18:00 +0900 Subject: [PATCH] =?UTF-8?q?Refactor=20:=20CI=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20-=20npm=20cache=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Client-CI.yml | 46 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/Client-CI.yml b/.github/workflows/Client-CI.yml index 3183a84..86951f7 100644 --- a/.github/workflows/Client-CI.yml +++ b/.github/workflows/Client-CI.yml @@ -2,10 +2,10 @@ name: Client Unit test on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] - + branches: ["main"] + jobs: run_test: runs-on: ubuntu-latest @@ -13,25 +13,27 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@v3 - - name: Set up Node.js 20.x - uses: actions/setup-node@v3 - with: - node-version: 20.x + - uses: actions/checkout@v3 + - name: Set up Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + cache-dependency-path: ./client + cache: "npm" + + - name: install deps + run: npm ci + working-directory: client + + - name: run test + run: npm run test:ci + working-directory: client - - name: install deps - run: npm install - working-directory: client - - - name: run test - run: npm run test:ci - working-directory: client - - - name: Request change - uses: actions/github-script@0.2.0 - with: - github-token: ${{github.token}} - script: | + - name: Request change + uses: actions/github-script@0.2.0 + with: + github-token: ${{github.token}} + script: | const ref = "${{github.ref}}" const pull_number = Number(ref.split("/")[2]) await github.pulls.createReview({ @@ -40,4 +42,4 @@ jobs: body:"[Unit test] 유닛테스트를 통과하지 못했습니다.", event: "REQUEST_CHANGES" }) - if: failure() + if: failure()