Skip to content

Merge pull request #672 from woowacourse-teams/feat/636-e2e-category-… #2

Merge pull request #672 from woowacourse-teams/feat/636-e2e-category-…

Merge pull request #672 from woowacourse-teams/feat/636-e2e-category-… #2

name: Frontend Playwright
on:
push:
branches:
- dev/fe
jobs:
test:
timeout-minutes: 60
runs-on:
- self-hosted
- spring
- develop
env:
frontend-directory: ./frontend
steps:
- uses: actions/checkout@v4
- name: 노드 환경 사용
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: 환경 파일 생성
run: |
if [ "${{ github.ref_name }}" == "main" ]; then
echo "REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }}" > ${{ env.frontend-directory }}/.env.production
echo "REACT_APP_BASE_URL=${{ secrets.REACT_APP_BASE_URL }}" >> ${{ env.frontend-directory }}/.env.production
else
echo "REACT_APP_API_URL=${{ secrets.REACT_APP_BETA_API_URL }}" > ${{ env.frontend-directory }}/.env.development
echo "REACT_APP_BASE_URL=${{ secrets.REACT_APP_BETA_BASE_URL }}" >> ${{ env.frontend-directory }}/.env.development
fi
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ${{ env.frontend-directory }}/.env.production
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> ${{ env.frontend-directory }}/.env.production
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ${{ env.frontend-directory }}/.env.sentry-build-plugin
- name: 환경 파일 권한 설정
run: chmod 644 ${{ env.frontend-directory }}/.env.*
- name: npm 패키지 설치
run: npm ci
working-directory: ${{ env.frontend-directory }}
- name: Playwright Browsers 설치
run: npx playwright install --with-deps
working-directory: ${{ env.frontend-directory }}
- name: Playwright 테스트 실행
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30