Giter VIP home page Giter VIP logo

hasura-ci-cd-action's Introduction

Hasura CI/CD Github Action

This action allows automatically running migrations and regression tests against a Hasura instance on changes.

The functionality lives inside of entrypoint.sh as a single bash script and is well-commented for those curious.

Currently only works with a single database tagged as default in your metadata

Inputs

inputs:
  PATH_TO_HASURA_PROJECT_ROOT:
    required: false
    description: The relative path from the root of your repo to where the Hasura project (containing config.yaml and your migrations/metadata folders) is located. For example, if your top-level directory contains a "hasura" folder, then this value should be ./hasura
  HASURA_CLI_VERSION:
    required: false
    description: Version of Hasura CLI to download and use. Defaults to 'latest' if not set.
  HASURA_ENDPOINT:
    required: false
    description: Optional overriding URL for the Hasura endpoint to call migrate apply and/or regression tests on. Will default to config.yaml value (as the CLI is run from the directory containing config.yaml).
  HASURA_ADMIN_SECRET:
    required: false
    description: Optional overriding admin secret for the Hasura instance. Will default to config.yaml value (as the CLI is run from the directory containing config.yaml).
  HASURA_MIGRATIONS_ENABLED:
    required: false
    description: Whether or not migrations should be run during CI/CD.
  HASURA_REGRESSION_TESTS_ENABLED:
    required: false
    description: Whether or not the CI/CD should attempt to run regression tests. Only available for Hasura Cloud and Hasura Enterprise users.
  HASURA_REGRESSION_TESTSUITE_ID:
    required: false
    description: The ID for the regression testsuite to run, if enabled.
  HASURA_PERSONAL_ACCESS_TOKEN:
    required: false
    description: A Personal Access Token
  HASURA_PROJECT_ID:
    required: false
    description: ID for the Hasura Cloud or Hasura Enterprise project to run regression tests on, if enabled

Example usage

name: Hasura CI/CD

on:
  push:
    branches:
      - develop

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Hasura CI/CD
        uses: GavinRay97/[email protected]
        with:
          PATH_TO_HASURA_PROJECT_ROOT: ./hasura
          HASURA_CLI_VERSION: v2.0.0-alpha.2
          HASURA_ENDPOINT: https://my-url.hasura.app
          HASURA_ADMIN_SECRET: ${{ secrets.HASURA_ADMIN_SECRET }}
          # If you want to disable either migrations or regression tests, make sure to remove them completely
          # The script only checks for their presence, not their value
          HASURA_MIGRATIONS_ENABLED: true
          HASURA_SEEDS_ENABLED: true
          HASURA_REGRESSION_TESTS_ENABLED: true
          HASURA_REGRESSION_TESTSUITE_ID: xxxxxx-xxx-xxxx-xxxxx-xxxxxx
          HASURA_PERSONAL_ACCESS_TOKEN: ${{ secrets.HASURA_PERSONAL_ACCESS_TOKEN }}
          HASURA_PROJECT_ID: xxxxxx-xxxx-xxx-xxxx-xxxxxxx

hasura-ci-cd-action's People

Contributors

gavinray97 avatar cj avatar browniefed avatar feritarou avatar

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.