Merging V4.0 changes to main #4
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: Cypress Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| cypress-run: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v3 | |
| - name: ⚙️ Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: 📦 Install test dependencies | |
| run: | | |
| npm install cypress http-server --save-dev | |
| - name: 🌐 Serve static site | |
| run: | | |
| npx http-server -p 8080 -c-1 . & # serve current directory | |
| env: | |
| CI: true | |
| - name: ⏳ Wait for static server to be ready | |
| uses: jakejarvis/wait-action@v0.1.1 | |
| with: | |
| url: 'http://localhost:8080' | |
| timeout: 30 | |
| - name: 🧪 Run Cypress tests | |
| run: npx cypress run | |
| - name: 📸 Upload screenshots (if failure) | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cypress-screenshots | |
| path: cypress/screenshots | |
| - name: 🎥 Upload videos (if failure) | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cypress-videos | |
| path: cypress/videos |