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..d8c98aee5 --- /dev/null +++ b/.github/workflows/frontend-ci.yml @@ -0,0 +1,38 @@ +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 + run: npm ci + + # 테스트 + - 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 }}