Giter Club home page Giter Club logo

setup-edgedb's Introduction

setup-edgedb build status

setup-edgedb v1

This action downloads and installs EdgeDB CLI and EdgeDB Server and makes both available in PATH.

Usage

See action.yml for the action's specification.

How this action works:

This action executes different commands depending on state of files in repository and inputs for action in workflow. It can:

  1. Install EdgeDB tools (CLI and server)
  2. Create new EdgeDB instance
  3. Initialize new EdgeDB project or link an existing one to remote instance

The following examples show how to use this action.

Example (installs stable EdgeDB CLI with server and makes them available in $PATH) Note: if your repository has edgedb.toml file, then this action will also initialize new project for your workflow. Otherwise, it will just install EdgeDB CLI and executable server that you can use on your own.

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    name: CI with EdgeDB action
    steps:
      - uses: actions/checkout@v2
      - uses: edgedb/setup-edgedb@v1
      - run: edgedb --version

Example (installs latest EdgeDB CLI without server and makes CLI available in $PATH)

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    name: CI with EdgeDB action
    steps:
      - uses: actions/checkout@v2
      - uses: edgedb/setup-edgedb@v1
        with:
          cli-version: nightly
          server-version: none
      - run: edgedb --version

Example (installs EdgeDB CLI with server, creates new EdgeDB instance and links it using edgedb project init) NOTE: this assumes that repository for the project has already been initialized using edgedb project init and edgedb.toml file exists in the repository.

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    name: CI with EdgeDB action
    steps:
      - uses: actions/checkout@v2
      - uses: edgedb/setup-edgedb@v1
      - run: edgedb query "SELECT 'Hello from GitHub Actions'"

Example (same as one above, but using services from GitHub Actions and edgedb project init --link)

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    name: CI with EdgeDB action
    services:
      edgedb:
        image: edgedb/edgedb:1-rc2
        env:
          EDGEDB_SERVER_SECURITY: insecure_dev_mode
        ports:
          - 5656:5656
    steps:
      - uses: actions/checkout@v2
      - uses: edgedb/setup-edgedb@v1
        with:
          server-dsn: edgedb://localhost:5656
          instance-name: ci_edgedb_instance  # optional
      - run: edgedb query "SELECT 'Hello from GitHub Actions'"

Example (creates new instance, but overrides server-version from edgedb.toml if project initialization is to be used)

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    name: CI with EdgeDB action
    steps:
      - uses: actions/checkout@v2
      - uses: edgedb/setup-edgedb@v1
        with:
          server-version: 1.0-rc.2
          instance-name: ci_edgedb_instance
      - run: edgedb query "SELECT 'Hello from GitHub Actions'"

setup-edgedb's People

Contributors

carsonf avatar dependabot[bot] avatar elprans avatar fmoor avatar nsidnev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-edgedb's Issues

How to install the most recent nightly version

When setting up edgedb, I use this config;

    - name: Install EdgeDB
      uses: edgedb/setup-edgedb@v1
      with:
        server-version: nightly
        cli-version: nightly

though it doesn't always install the most recent build. The package index for nightly brings 3 different revisions;

{
    "packages": [
        {
            "basename": "edgedb-cli",
            "slot": null,
            "name": "edgedb-cli",
            "version": "1.0.0-beta.1+d20210305.ga681830f0",
            "revision": "2021030500~nightly",
            "architecture": "x86_64",
            "installref": "/archive/linux-x86_64.nightly/edgedb-cli_1.0.0-beta.1+d20210305.ga681830f0_2021030500~nightly"
        },
        {
            "basename": "edgedb-cli",
            "slot": null,
            "name": "edgedb-cli",
            "version": "1.0.0-beta.1+d20210306.g6967c073b",
            "revision": "2021030600~nightly",
            "architecture": "x86_64",
            "installref": "/archive/linux-x86_64.nightly/edgedb-cli_1.0.0-beta.1+d20210306.g6967c073b_2021030600~nightly"
        },
        {
            "basename": "edgedb-cli",
            "slot": null,
            "name": "edgedb-cli",
            "version": "1.0.0-beta.1+d20210307.g6967c073b",
            "revision": "2021030700~nightly",
            "architecture": "x86_64",
            "installref": "/archive/linux-x86_64.nightly/edgedb-cli_1.0.0-beta.1+d20210307.g6967c073b_2021030700~nightly"
        }
    ]
}

and I personally don't know why though setup-edgedb installs the least recent one (march 5). I was wondering whether there is an easy hack that I could use to install the most recent one. In this case, a fix that I was awaiting was fixed in march 6 but for it to be least recent one I guess I have to wait 2 days.

Not working with edgedb.toml not in root directory

Trying to run tests with github actions.
My project, unlike tests, does not require to run edgedb, so my edgedb.toml file is located inside tests directory.

- run: edgedb project init --non-interactive
  working-directory: tests
Click to see traceback
Run edgedb project init --non-interactive
Found `edgedb.toml` in /home/runner/work/edgeql-hello-world/edgeql-hello-world/tests
Initializing project...
Checking EdgeDB versions...
┌────────────────────────┬─────────────────────────────────────────────────────────┐
Version 1.4+5ffe34b is already installed
Initializing EdgeDB instance...
│ Project directory      │ /home/runner/work/edgeql-hello-world/edgeql-hello-world/tests             │
│ Project config         │ /home/runner/work/edgeql-hello-world/edgeql-hello-worldtests/edgedb.toml │
│ Schema dir (non-empty) │ /home/runner/work/edgeql-hello-world/edgeql-hello-world/tests/dbschema    │
│ Installation method    │ portable package                                        │
│ Start configuration    │ auto                                                    │
│ Version                │ 1.4+5ffe34b                                             │
│ Instance name          │ tests                                                   │
└────────────────────────┴─────────────────────────────────────────────────────────┘
Failed to connect to bus: No such file or directory
Applying migrations...
Applied m13n3l3xj2fzmqa5dqaoe32wl3bo3djbbxuou7d2vjocoeotgaj7gq (00001.edgeql)
Applied m16o3zi7bwy6zdcuq4nexyyctephv5ghqtrqanmywux6o5woutdlza (00002.edgeql)
Note: adding first migration disables DDL. More info: https://edgedb.com/p/bare_ddl
WARNING 1794 2022-05-26T12:24:11.625 edb.server: Released an unhealthy pgcon; discard now.
---- Exception occurred ----

1. ConnectionAbortedError: 

---- Traceback ----

    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 1156, in task
        > await self.introspect_db(dbname)
    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 679, in introspect_db
        > user_schema = await self.introspect_user_schema(conn)
    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 629, in introspect_user_schema
        > json_data = await conn.parse_execute_json(
    edb/server/pgcon/pgcon.pyx, line 794, in parse_execute_json
        
    edb/server/pgcon/pgcon.pyx, line 744, in _parse_execute_json
        
    edb/server/pgcon/pgcon.pyx, line 688, in _parse_execute_to_buf
        
    edb/server/pgcon/pgcon.pyx, line 2157, in wait_for_message
        

ConnectionAbortedError: 
ERROR 1794 2022-05-26T12:24:11.625 asyncio: Task exception was never retrieved
future: <Task finished name='Task-37' coro=<Server._on_local_database_config_change.<locals>.task() done, defined at /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py:1154> exception=ConnectionAbortedError()>
---- Exception occurred: the database system is shutting down ----

1. edb.server.pgcon.errors.BackendError: the database system is shutting down

---- Traceback ----

    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/connpool/pool.py, line 514, in _connect
        > conn = await self._connect_cb(block.dbname)
    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 333, in _pg_connect
        > rv = await pgcon.connect(
    edb/server/pgcon/pgcon.pyx, line 322, in connect
        
    edb/server/pgcon/pgcon.pyx, line 277, in _connect
        
    edb/server/pgcon/pgcon.pyx, line 273, in edb.server.pgcon.pgcon._connect
        
    edb/server/pgcon/pgcon.pyx, line 1785, in connect
        

edb.server.pgcon.errors.BackendError: the database system is shutting down
ERROR 1794 2022-05-26T12:24:11.640 edb.server: Failed to establish a new connection to backend database: edgedb
---- Exception occurred: the database system is shutting down ----

1. edb.server.pgcon.errors.BackendError: the database system is shutting down

---- Traceback ----

    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/connpool/pool.py, line 514, in _connect
        > conn = await self._connect_cb(block.dbname)
    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 333, in _pg_connect
        > rv = await pgcon.connect(
    edb/server/pgcon/pgcon.pyx, line 322, in connect
        
    edb/server/pgcon/pgcon.pyx, line 277, in _connect
        
    edb/server/pgcon/pgcon.pyx, line 273, in edb.server.pgcon.pgcon._connect
        
    edb/server/pgcon/pgcon.pyx, line 1785, in connect
        

edb.server.pgcon.errors.BackendError: the database system is shutting down
ERROR 1794 2022-05-26T12:24:11.643 edb.server: Failed to establish a new connection to backend database: edgedb
---- Exception occurred: the database system is shutting down ----

1. edb.server.pgcon.errors.BackendError: the database system is shutting down

---- Traceback ----

    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/connpool/pool.py, line 514, in _connect
        > conn = await self._connect_cb(block.dbname)
    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 333, in _pg_connect
        > rv = await pgcon.connect(
    edb/server/pgcon/pgcon.pyx, line 322, in connect
        
    edb/server/pgcon/pgcon.pyx, line 277, in _connect
        
    edb/server/pgcon/pgcon.pyx, line 273, in edb.server.pgcon.pgcon._connect
        
    edb/server/pgcon/pgcon.pyx, line 1785, in connect
        

edb.server.pgcon.errors.BackendError: the database system is shutting down
ERROR 1794 2022-05-26T12:24:11.648 edb.server: Failed to establish a new connection to backend database: edgedb
---- Exception occurred: the database system is shutting down ----

1. edb.server.pgcon.errors.BackendError: the database system is shutting down

---- Traceback ----

    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/connpool/pool.py, line 514, in _connect
        > conn = await self._connect_cb(block.dbname)
    /home/runner/.local/share/edgedb/portable/1.4/lib/python3.10/site-packages/edb/server/server.py, line 333, in _pg_connect
        > rv = await pgcon.connect(
    edb/server/pgcon/pgcon.pyx, line 322, in connect
        
    edb/server/pgcon/pgcon.pyx, line 277, in _connect
        
    edb/server/pgcon/pgcon.pyx, line 273, in edb.server.pgcon.pgcon._connect
        
    edb/server/pgcon/pgcon.pyx, line 1785, in connect
        

edb.server.pgcon.errors.BackendError: the database system is shutting down
ERROR 1794 2022-05-26T12:24:11.652 edb.server: Failed to establish a new connection to backend database: edgedb
Bootstrapping complete, but there was an error creating the service: systemctl failed: exit status: 1 (command-line: "systemctl" "--user" "enable" "[email protected]")
You can start it manually via:
  edgedb instance start tests

Action fails with 404

Hello. We're using this action in one of our github workflows. It fails with the following error:

Run edgedb/setup-edgedb@v1
Downloading edgedb-cli 3.4.0+160d07d - x64 from https://packages.edgedb.com/archive/x86_64-unknown-linux-musl/edgedb-cli-3.4.0+160d07d
Error: Unexpected HTTP response: 404

This is how we are running the action:

    steps:
      - uses: actions/checkout@v3

      - name: Setup EdgeDB
        uses: edgedb/setup-edgedb@v1
        with:
          server-dsn: edgedb://edgedb:edgedb@localhost:5656

Installing stable doesn't work

https://github.com/edgedb/edgedb-js/runs/1552097452
The error is:

Starting EdgeDB test cluster...
Error: spawn edgedb-server-1-alpha6-dev5104 ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:247:19)
    at onErrorNT (internal/child_process.js:429:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)

Not sure if this is an error of CLI or the action itself. Looks more like CLI because the package version is wrong, but I don't see CLI output to debug the issue :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.