From c55f9fc20f493c55a3b082e5145cc831e34496b4 Mon Sep 17 00:00:00 2001 From: youngsu5582 <98307410+youngsu5582@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:45:13 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-ci.yml | 52 ++++++++++++++++++++++++++++++ .github/workflows/frontend-ci.yml | 46 ++++++++++++++++++++++++++ .github/workflows/storybook-cd.yml | 34 +++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 .github/workflows/backend-ci.yml create mode 100644 .github/workflows/frontend-ci.yml create mode 100644 .github/workflows/storybook-cd.yml diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml new file mode 100644 index 000000000..b6d324d80 --- /dev/null +++ b/.github/workflows/backend-ci.yml @@ -0,0 +1,52 @@ +name: Ci Back + +on: + pull_request: + branches: + - 'develop' + paths: ['backend/**'] + +defaults: + run: + working-directory: backend + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Repository checkout + uses: actions/checkout@v3 + + - name: Setup java 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'zulu' + + - name: Cache gradle packages + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Assign grant gradlew + run: chmod +x gradlew + + - name: Test with gradle + run: ./gradlew --info test + + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: '**/build/test-results/test/TEST-*.xml' + + - name: Publish test report + uses: mikepenz/action-junit-report@v4 + if: always() + with: + report_paths: '**/build/test-results/test/TEST-*.xml' diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml new file mode 100644 index 000000000..30db77c88 --- /dev/null +++ b/.github/workflows/frontend-ci.yml @@ -0,0 +1,46 @@ +name: frontend CI Workflow +on: + pull_request: + branches: + - 'develop' + paths: ['frontend/**'] + +defaults: + run: + working-directory: frontend + +jobs: + build: + timeout-minutes: 10 + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + steps: + # 해당 저장소의 코드를 가져온다 + - name: Checkout + uses: actions/checkout@v4 + + # 노드 설치 + - name: Install Nodejs + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + # 패키지 설치 + - name: Install dependencies + uses: npm ci + + # ESLint 검사 + - name: Run eslint + run: npm run lint + + # Prettier 검사 + - name: Run Prettier + run: npm run format + + # 테스트 + - name: Run tests + run: npm test diff --git a/.github/workflows/storybook-cd.yml b/.github/workflows/storybook-cd.yml new file mode 100644 index 000000000..7ce1d885e --- /dev/null +++ b/.github/workflows/storybook-cd.yml @@ -0,0 +1,34 @@ +name: frontend storybook deploy Workflow +on: + pull_request: + branches: + - 'develop' + paths: ['frontend/**/*.stories.ts', 'frontend/**/*.stories.tsx'] + +defaults: + run: + working-directory: frontend + +jobs: + build: + timeout-minutes: 10 + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + steps: + # 해당 저장소의 코드를 가져온다 + - name: Checkout + uses: actions/checkout@v4 + + # 노드 설치 + - name: Install Nodejs + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + # 스토리북 배포 + - name: Install dependencies + run: npx chromatic --project-token=${{ secrets.STORY_BOOK_TOKEN }}