I have a CI pipeline setup using Github Action/Workflows, where I want to run Cypress Automated tests; however I am having some problems of when trying to run my dev server. Let me show you my pipeline:
name: Nuxt CI Pipeline
on:
push:
branches: [ CI-pipeline ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_ENV: staging
file_name: .env
- run: npm ci
- run: npm run dev
- run: |
cd e2e
ls -l
npm ci
npx cypress run
Now I want to spin up the devserver and run the tests on that port usually 3000; however the problem is when the command npm run dev
is executed, the pipeline keeps on waiting there and doesn't move forward to the next commands, which makes sense as devserver doesn't return a response – it listens on that port until explicitly closed. I'm stuck here. My knowledge of devops is the bare minimum; can someone point out what I am missing?