# Use TypeDB in GitHub Actions

This guide shows you how to get a running instance of TypeDB into your GitHub Actions CI pipeline using the TypeDB GitHub Action.

## [](#_step_1_install_and_run_typedb)Step 1. Install and run TypeDB

We install and run TypeDB using the `typedb/setup-typedb` GitHub Action, specifying the `typedb_version` to use as required.

```yaml
name: TypeDB

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup TypeDB
        uses: typedb/setup-typedb@1.0.0
        with:
          typedb_version: 3.5.1
```

## [](#_step_2_arguments)Step 2. Arguments

The TypeDB GitHub Action supports a number of arguments for configuring TypeDB as required.

   

Argument

Description

Default

Value

`typedb_version`

The version of TypeDB to use

latest

A TypeDB version (e.g. `3.5.0`) or `latest`

`typedb_grpc_port`

TypeDB’s port for gRPC connections

1729

Valid port number

`typedb_http_port`

TypeDB’s port for HTTP connections

8000

Valid port number

`typedb_args`

Additional arguments to pass to TypeDB

[TypeDB CLI arguments](../../../maintenance-operation/typedb-configuration/index.md)

## [](#_usage_example_set_up_a_database)Usage example: Set up a database

Once the `setup-typedb` step has been run in a job, there’ll be a TypeDB instance running for that job. You’ll also have access to the TypeDB Console CLI, which you could use for tasks such as loading schema and data to run tests against:

```yaml
name: TypeDB

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup TypeDB
        uses: typedb/setup-typedb@1.0.0
        with:
          typedb_version: 3.5.1

      - name: Create and initialise database
        run: |
          typedb console --address=localhost:1729 --tls-disabled \
            --username=admin --password=password \
            --command="database create-init test-db path/to/schema.tql path/to/data.tql"
```

## [](#_step_3_commit_and_push)Step 3. Commit and push

Once your workflow file is set up, you can run it by committing and pushing to GitHub:

```bash
git add .github/workflows/workflow.yml
git commit -m "Add TypeDB workflow"
git push
```

## [](#_step_4_view_the_workflow_run)Step 4. View the workflow run

Once your workflow is set up, you can view the workflow run in the "Actions" tab of your repository on GitHub.

## [](#_conclusion)Conclusion

This workflow demonstrates how to use the TypeDB GitHub Action to run a specific version of TypeDB in a CI pipeline.

This approach enables fast, isolated, and reproducible testing environments in GitHub Actions.

## [](#_next_steps)Next steps

[Drivers](../../../core-concepts/drivers/overview/index.md)

Learn how to connect to TypeDB through our drivers

[Use Cases](../../../use-cases/index.md)

View example TypeDB applications and datasets

[Maintenance & Operation](../../../maintenance-operation/index.md)

Learn how to maintain and operate TypeDB servers.

[Deploy TypeDB via the Cloud API](../deploy-through-api/index.md) [Graph Visualisation for TypeDB Data](../graph-viz/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/guides/modules/ROOT/pages/integrations/use-github-actions.adoc) Edit this page on GitHub.