chore: workflows/ci - playwright-report 적용 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- refactor # 테스트 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-node- | |
path: '**/node_modules' | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Packages | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install | |
- name: Run Unit and Integration Tests | |
run: yarn run test | |
e2e: | |
runs-on: ubuntu-latest | |
env: | |
NOTION_ROOT_PAGE_ID: ${{ secrets.NOTION_ROOT_PAGE_ID }} | |
NOTION_ACTIVE_USER_ID: ${{ secrets.NOTION_ACTIVE_USER_ID }} | |
NOTION_AUTH_TOKEN: ${{ secrets.NOTION_AUTH_TOKEN }} | |
NOTION_API_TOKEN: ${{ secrets.NOTION_API_TOKEN }} | |
NOTION_DB_ID: ${{ secrets.NOTION_DB_ID }} | |
NOTION_PORTFOLIO_PAGE_ID: ${{ secrets.NOTION_PORTFOLIO_PAGE_ID }} | |
BLOG_ODR_TOKEN: ${{ secrets.BLOG_ODR_TOKEN }} | |
NEXT_PUBLIC_GA_ID: ${{ secrets.NEXT_PUBLIC_GA_ID }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-node- | |
path: '**/node_modules' | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Packages | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install | |
- name: Build project | |
run: yarn build | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Start e2e test | |
run: yarn e2e | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |