Update 8-7-2024 #99
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: Unit and E2E tests | |
on: | |
push: | |
branches: [main, Dev] | |
pull_request: | |
branches: [main, Dev] | |
jobs: | |
tests: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare .env file | |
run: | | |
rm -f .env && touch .env | |
echo "REACT_APP_API_BASE_URL=https://example.com" >> .env | |
echo "VITE_SERVICE_ID=123fAkE" >> .env | |
echo "VITE_TEMPLATE_ID=123fAkE" >> .env | |
echo "VITE_PUBLIC_ID=123fAkE" >> .env | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Install dependencies | |
run: npm install | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Build the app | |
run: npm run build | |
- name: Run Unit tests | |
run: npm run test | |
- name: Run Playwright tests | |
run: npm run test:e2e | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 5 |