这是indexloc提供的服务,不要输入任何密码
Skip to content

hasura migrate commands not working with GitHub Actions #3638

@joshuarobs

Description

@joshuarobs

Edit: I've added a test repo that anyone can clone and try it out for themselves: https://github.com/joshuarobs/making-hasura-work-with-github-actions
Simply just clone it, push something to master and watch the magic "happen" (hint: it doesn't)

Here's a link to the latest build run log which failed: https://github.com/joshuarobs/making-hasura-work-with-github-actions/runs/375147959

This is my .github/workflows/nodejs.yml file:

name: Node CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-16.04

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - uses: actions/checkout@v1
    - name: Install Hasura cli
      run: curl -L https://github.com/hasura/graphql-engine/raw/master/cli/get.sh | bash
    - name: Start up the Docker containers and migrate to the latest version of the database
      run: |
        docker-compose up -d
        sleep 4
        cd docker
        echo $(docker ps)
        hasura migrate status --skip-update-check --endpoint http://localhost:8080
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm install, build, and test
      run: |
        npm ci
        npm run build --if-present
        npm test
      env:
        CI: true
        DB_ENDPOINT: http://localhost:8080/v1/graphql

When it gets to the hasura migrate status --skip-update-check --endpoint http://localhost:8080 it fails, giving me this error:

time="2020-01-06T05:16:59Z" level=fatal msg="version check: failed to get version from server: failed making version api call: Get http://localhost:8080/v1/version: read tcp 127.0.0.1:39732->127.0.0.1:8080: read: connection reset by peer"
28
##[error]Process completed with exit code 1.

If I try to run hasura migrate status --skip-update-check --endpoint http://localhost:8080 locally on my machine, it works fine. But when I try to do it with GitHub Actions, it fails.

So...

  • Is anyone else having this issue, trying to run Hasura cli commands on GitHub Actions?
  • Is this the fault of Hasura? (Personally, I don't think so, since running it locally works fine for me)
  • Is this the fault of GitHub Actions not letting me somehow access a docker container?
  • Is there any other CI that doesn't have this kind of problem?

I've added a test repo that anyone can clone and try it out for themselves: https://github.com/joshuarobs/making-hasura-work-with-github-actions
Simply just clone it, push something to master and watch the magic "happen" (hint: it doesn't)

Here's a link to the latest build run log which failed: https://github.com/joshuarobs/making-hasura-work-with-github-actions/runs/375147959

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions