feat(ci): performance optimization #1875
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: E2E tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out backend | |
uses: actions/checkout@v4 | |
with: | |
repository: brocoders/nestjs-boilerplate | |
# Use token for private repository | |
# token: ${{ secrets.CI_PAT }} | |
path: backend | |
- run: cd backend && cp env-example-document .env | |
- run: cd backend && sed -i 's/APP_PORT=3000/APP_PORT=3001/g' .env | |
- run: cd backend && sed -i 's/BACKEND_DOMAIN=http:\/\/localhost:3000/BACKEND_DOMAIN=http:\/\/localhost:3001/g' .env | |
- name: Run backend | |
# print output of the command to file and store it as artifact | |
run: cd backend && docker compose -f docker-compose.document.yaml up > ${{ runner.temp }}/backend.log 2>&1 & | |
- run: cd backend && sed -i 's/\r//g' wait-for-it.sh | |
- run: cd backend && ./wait-for-it.sh localhost:3001 -- echo "Backend is up" | |
- name: Check out frontend | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run lint | |
run: npm run lint | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps chromium | |
- name: Run Playwright tests | |
run: npx playwright test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: backend-log | |
path: ${{ runner.temp }}/backend.log | |
retention-days: 30 |