Github 操作:运行木偶时出现错误:net::ERR_CONNECTION_REFUSED

Ash*_*hik 6 github mocha.js puppeteer github-actions

当分支中发生任何推送时,我想运行我的应用程序并使用 puppeteer 测试某些内容。但是当测试文件在 github 操作中执行时,我收到以下错误

Error: net::ERR_CONNECTION_REFUSED at http://localhost:8080 at navigate (node_modules/puppeteer/lib/FrameManager.js:120:37)

其中,8080 是我的前端端口。

是什么原因导致此错误以及如何解决此问题?

这是我的 gihub 操作文件:

name: "Github Actions Test"
on:
  push:
    branches:
      - wip/checkout2

jobs:
  test:
    runs-on: ubuntu-latest

    env:
      PRISMA_ENDPOINT: ${{secrets.PRISMA_ENDPOINT}}
      PRISMA_SECRET: ${{secrets.PRISMA_SECRET}}

    steps:
      - uses: actions/checkout@v1
      - name: "Install Node"
        uses: actions/setup-node@v1
        with:
          node-version: "12.x"
      - name: "Install global packages"
        run: npm install -g yarn prisma-cli concurrently mocha
      - name: "Run docker Container"
        run: docker-compose -f docker-compose.yml up --build -d
      - name: "Install deps"
        run: yarn install
      - name: "prisma deploy"
        run: yarn deploy:backend
      - name: "Seed Backend"
        run: yarn seed:backend
      - name: "Build app"
        run: yarn build
      - name: "Start backend and frontend concurrently on background and run tests"
        run: |
          yarn start &
          yarn test

Run Code Online (Sandbox Code Playgroud)