try installing http-server locally #9
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: push | |
| jobs: | |
| cypress-run: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| npm install | |
| npm install --save-dev http-server | |
| # Start the server and serve the HTML file | |
| - name: Start http-server | |
| run: | | |
| nohup http-server -p 3000 . & | |
| sleep 5 # Give the server some time to start | |
| # and run all Cypress tests | |
| - name: Cypress run | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| browser: chrome | |
| config: pageLoadTimeout=100000,baseUrl=http://localhost:3000 |