Continuous Integration with Inso CLI

Related Documentation
Tags
Related Resources

Inso CLI is designed to run in a Continuous Integration (CI) environment. It disables prompts and provides exit codes to pass or fail the CI workflow.

You can use the Setup Inso GitHub Action to perform Inso CLI tasks in your repository’s GitHub Actions.

GitHub Action example

The following sample GitHub Actions performs the following tasks:

  1. Checks out branch
  2. Downloads Setup Inso
  3. Runs linting
  4. Runs legacy unit tests

Here’s the example Inso CLI GitHub Action:

v13.3+ inso run test runs legacy unit tests, which are hidden in the app by default and are planned for deprecation in a future release. To create or edit these tests in Insomnia, go to Preferences > General > Application and enable Show legacy unit tests. For new work, use pre-request and after-response scripts and run them with inso run collection.

name: Test

jobs:
  Linux:
    name: Validate API spec
    runs-on: ubuntu-latest
    steps:
      - name: Checkout branch
        uses: actions/checkout@v1
      - uses: kong/setup-inso@v2
        with:
          inso-version: 11.3.0
      - name: Lint
        run: inso lint spec "Designer Demo" --ci
      - name: Run test suites
        run: inso run test "Designer Demo" --env UnitTest --ci

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!