2020-04-26 20:33:39 +00:00
|
|
|
name: Test
|
|
|
|
|
2020-05-28 22:45:37 +00:00
|
|
|
on:
|
2023-03-31 10:51:31 +00:00
|
|
|
merge_group:
|
2021-11-25 13:18:29 +00:00
|
|
|
workflow_dispatch:
|
2020-05-28 22:45:37 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- synchronize
|
2020-04-26 20:33:39 +00:00
|
|
|
|
2022-02-10 16:07:11 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-04-26 20:33:39 +00:00
|
|
|
jobs:
|
2023-08-10 15:53:18 +00:00
|
|
|
Test:
|
2024-02-05 15:05:34 +00:00
|
|
|
timeout-minutes: 25
|
2023-08-10 20:29:00 +00:00
|
|
|
runs-on: ubuntu-latest
|
2020-04-26 20:33:39 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
2024-02-27 14:49:14 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-10-12 00:10:09 +00:00
|
|
|
- name: Setup Node
|
2024-02-27 14:49:14 +00:00
|
|
|
uses: actions/setup-node@v4
|
2020-04-26 20:33:39 +00:00
|
|
|
with:
|
2023-03-31 10:51:31 +00:00
|
|
|
node-version-file: ".nvmrc"
|
2023-08-09 22:14:16 +00:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: package-lock.json
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2023-08-09 22:14:16 +00:00
|
|
|
- name: Install packages
|
|
|
|
run: npm ci
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-05-12 06:35:00 +00:00
|
|
|
- name: Lint
|
|
|
|
run: npm run lint
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
- name: Lint markdown
|
2021-08-27 03:44:01 +00:00
|
|
|
run: npm run lint:markdown
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-11-03 08:06:52 +00:00
|
|
|
- name: Type checks
|
|
|
|
run: npm run type-check
|
|
|
|
|
2023-08-13 10:30:04 +00:00
|
|
|
- name: Test Insomnia
|
|
|
|
run: npm test -w packages/insomnia
|
|
|
|
|
|
|
|
- name: Test Inso
|
|
|
|
run: npm test -w packages/insomnia-inso
|
|
|
|
|
|
|
|
- name: Test Insomnia Testing
|
|
|
|
run: npm test -w packages/insomnia-testing
|
|
|
|
|
|
|
|
- name: Test O2K
|
|
|
|
run: npm test -w packages/openapi-2-kong
|
2021-10-12 00:10:09 +00:00
|
|
|
|
2021-12-17 12:05:14 +00:00
|
|
|
- name: Build app for smoke tests
|
2023-08-15 12:46:40 +00:00
|
|
|
run: NODE_OPTIONS='--max_old_space_size=6144' npm run app-build
|
2021-12-17 12:05:14 +00:00
|
|
|
|
2023-08-13 10:30:04 +00:00
|
|
|
- name: Smoke test electron app
|
2022-10-11 08:56:12 +00:00
|
|
|
# Partial Smoke test run, for regular CI triggers
|
2023-08-11 08:22:01 +00:00
|
|
|
if: ${{ !startsWith(github.head_ref, 'release/') }}
|
2023-08-13 10:30:04 +00:00
|
|
|
run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke
|
2022-10-11 08:56:12 +00:00
|
|
|
|
2023-08-13 10:30:04 +00:00
|
|
|
- name: Prerelease test electron app
|
2022-10-11 08:56:12 +00:00
|
|
|
# Full Smoke test run, for Release PRs
|
2023-08-11 08:22:01 +00:00
|
|
|
if: ${{ startsWith(github.head_ref, 'release/') }}
|
2023-08-13 10:30:04 +00:00
|
|
|
run: npm run test:build -w packages/insomnia-smoke-test -- --project=Default
|
2021-12-17 12:05:14 +00:00
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
- name: Set Inso CLI variables
|
2021-10-12 00:10:09 +00:00
|
|
|
id: inso-variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-03-17 10:05:37 +00:00
|
|
|
INSO_VERSION="$(jq .version packages/insomnia-inso/package.json -rj)-run.${{ github.run_number }}"
|
2023-08-11 08:22:01 +00:00
|
|
|
PKG_NAME="inso-ubuntu-latest-$INSO_VERSION"
|
2022-10-17 12:14:47 +00:00
|
|
|
echo "pkg-name=$PKG_NAME" >> $GITHUB_OUTPUT
|
|
|
|
echo "inso-version=$INSO_VERSION" >> $GITHUB_OUTPUT
|
2021-10-12 00:35:59 +00:00
|
|
|
|
2022-10-14 08:27:10 +00:00
|
|
|
- name: Run Inso NPM package tests
|
|
|
|
run: npm run test:bundled-inso
|
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
- name: Package Inso CLI binary
|
2023-08-09 22:14:16 +00:00
|
|
|
run: |
|
2023-08-13 10:30:04 +00:00
|
|
|
echo "Replacing node-libcurl electron binary with node binary"
|
2023-08-09 22:14:16 +00:00
|
|
|
node_modules/.bin/node-pre-gyp install --update-binary --directory node_modules/@getinsomnia/node-libcurl
|
|
|
|
npm run inso-package
|
2021-10-12 00:35:59 +00:00
|
|
|
env:
|
|
|
|
VERSION: ${{ steps.inso-variables.outputs.inso-version }}
|
2021-10-12 00:10:09 +00:00
|
|
|
|
|
|
|
- name: Create Inso CLI artifacts
|
2021-10-12 21:23:25 +00:00
|
|
|
run: npm run inso-package:artifacts
|
2021-10-14 22:16:30 +00:00
|
|
|
env:
|
|
|
|
VERSION: ${{ steps.inso-variables.outputs.inso-version }}
|
2021-10-12 00:10:09 +00:00
|
|
|
|
|
|
|
- name: Upload Inso CLI artifacts
|
2024-02-27 14:49:14 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-10-06 22:01:43 +00:00
|
|
|
with:
|
|
|
|
if-no-files-found: ignore
|
2021-10-12 00:10:09 +00:00
|
|
|
name: ${{ steps.inso-variables.outputs.pkg-name }}
|
2021-10-12 21:23:25 +00:00
|
|
|
path: packages/insomnia-inso/artifacts
|
2021-12-14 14:26:36 +00:00
|
|
|
|
2023-08-13 10:30:04 +00:00
|
|
|
- name: Smoke test Inso CLI
|
2021-10-14 23:00:06 +00:00
|
|
|
run: npm run test:smoke:cli
|
2021-10-12 00:10:09 +00:00
|
|
|
|
2023-09-24 23:12:50 +00:00
|
|
|
# This step should always run even when previous steps fail
|
2023-08-10 15:53:18 +00:00
|
|
|
- name: Upload smoke test traces
|
2024-02-27 14:49:14 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-09-24 23:12:50 +00:00
|
|
|
if: failure()
|
2021-10-14 23:00:06 +00:00
|
|
|
with:
|
|
|
|
if-no-files-found: ignore
|
2023-08-11 08:22:01 +00:00
|
|
|
name: ubuntu-smoke-test-traces-${{ github.run_number }}
|
2023-08-10 15:53:18 +00:00
|
|
|
path: packages/insomnia-smoke-test/traces
|