Github actions inso readme (#2374)

This commit is contained in:
Opender Singh 2020-07-14 11:45:49 +12:00 committed by GitHub
parent 2d41dad701
commit 0c13f1598e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,34 @@ inso run test spc_46c5a4 --reporter progress --bail --keep-file
More examples: [#2338](https://github.com/Kong/insomnia/pull/2338).
</details>
## Continuous Integration
`inso` has been designed to run in a CI environment, disabling prompts and providing exit codes to pass or fail the CI workflow accordingly. An example workflow run in Github Actions is as follows. This example will checkout > install NodeJS > install inso > run linting > run unit tests > generate configuration. If any of these steps fail, the GH workflow will as well.
```yaml
# .github/workflows/test.yml
name: Test
jobs:
Linux:
name: Validate API spec
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v1
- name: Install NodeJS
uses: actions/setup-node@v1
- name: Install inso
run: npm install -g insomnia-inso
- name: Lint
run: inso lint spec "Designer Demo" --ci
- name: Run test suites
run: inso run test "Designer Demo" --env UnitTest --ci
- name: Generate declarative config
run: inso generate config "Designer Demo" --type declarative --ci
```
## Development
* Bootstrap: `npm run bootstrap`