[25.07.26 / TASK-229] Feature - FE Git Action E2E CI 적용 #12
Workflow file for this run
This file contains hidden or 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: Process E2E Testing | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
process-e2e-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 23 | |
- name: Install dependencies | |
run: | | |
npm install -g pnpm | |
pnpm install --frozen-lockfile | |
npx cypress install | |
- name: Create .env file for Testing | |
run: | | |
echo "NEXT_PUBLIC_BASE_URL=http://localhost:3000" >> .env | |
echo "NEXT_PUBLIC_CHANNELTALK_PLUGIN_KEY=sample_key" >> .env | |
echo "NEXT_PUBLIC_GA_ID=sample_id" >> .env | |
echo "NEXT_PUBLIC_SENTRY_AUTH_TOKEN=sample_token" >> .env | |
echo "NEXT_PUBLIC_SENTRY_DSN=sample_dsn" >> .env | |
- name: Start application server | |
run: | | |
pnpm dev & | |
env: | |
CI: true | |
- name: Wait for server | |
run: npx wait-on http://localhost:3000 --timeout 60000 | |
- name: Run Cypress tests | |
uses: cypress-io/github-action@v6 | |
with: | |
browser: chrome | |
headless: true | |
record: false | |
wait-on: 'http://localhost:3000' | |
wait-on-timeout: 120 | |
install: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NEXT_PUBLIC_BASE_URL: 'http://localhost:3000' | |
NEXT_PUBLIC_CHANNELTALK_PLUGIN_KEY: 'sample_key' | |
NEXT_PUBLIC_GA_ID: 'sample_id' | |
NEXT_PUBLIC_SENTRY_AUTH_TOKEN: 'sample_token' | |
NEXT_PUBLIC_SENTRY_DSN: 'sample_dsn' | |
- name: Upload screenshots | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots |