2020-04-26 20:33:39 +00:00
|
|
|
name: Test
|
|
|
|
|
2020-05-28 22:45:37 +00:00
|
|
|
on:
|
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:
|
2020-08-25 20:45:58 +00:00
|
|
|
OS:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2020-08-30 11:17:15 +00:00
|
|
|
fail-fast: false
|
2020-08-25 20:45:58 +00:00
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
2020-04-26 20:33:39 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
2022-03-09 15:06:53 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-10-12 00:10:09 +00:00
|
|
|
- name: Setup Node
|
2022-03-09 15:06:53 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-04-26 20:33:39 +00:00
|
|
|
with:
|
2022-02-09 16:35:34 +00:00
|
|
|
node-version-file: '.nvmrc'
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2020-04-26 20:33:39 +00:00
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-05-12 06:35:00 +00:00
|
|
|
- name: Lint
|
2022-02-02 11:11:13 +00:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2021-05-12 06:35:00 +00:00
|
|
|
run: npm run lint
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
- name: Lint markdown
|
2022-02-02 11:11:13 +00:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
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
|
2022-02-02 11:11:13 +00:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2021-11-03 08:06:52 +00:00
|
|
|
run: npm run type-check
|
|
|
|
|
2020-04-26 20:33:39 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: npm test
|
2021-10-12 00:10:09 +00:00
|
|
|
|
2021-12-17 12:05:14 +00:00
|
|
|
- name: Build app for smoke tests
|
2022-06-28 09:29:28 +00:00
|
|
|
env:
|
|
|
|
NODE_OPTIONS: '--max_old_space_size=6144'
|
2022-03-16 09:36:41 +00:00
|
|
|
run: npm run app-build
|
2021-12-17 12:05:14 +00:00
|
|
|
|
|
|
|
- name: Run app smoke tests
|
|
|
|
run: npm run test:smoke:build
|
|
|
|
|
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 }}"
|
2021-10-12 00:35:59 +00:00
|
|
|
PKG_NAME="inso-${{ matrix.os }}-$INSO_VERSION"
|
2021-10-12 00:10:09 +00:00
|
|
|
|
|
|
|
echo ::set-output name=pkg-name::$PKG_NAME
|
2021-10-12 00:35:59 +00:00
|
|
|
echo ::set-output name=inso-version::$INSO_VERSION
|
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
- name: Package Inso CLI binary
|
2021-10-12 00:35:59 +00:00
|
|
|
run: npm run inso-package
|
|
|
|
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
|
2022-03-09 15:06:53 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
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
|
|
|
|
2021-10-14 23:00:06 +00:00
|
|
|
- name: Run Inso CLI smoke tests
|
|
|
|
run: npm run test:smoke:cli
|
2021-10-12 00:10:09 +00:00
|
|
|
|
2021-10-14 23:00:06 +00:00
|
|
|
- name: Upload smoke test screenshots
|
2022-03-09 15:06:53 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-10-14 23:00:06 +00:00
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
if-no-files-found: ignore
|
|
|
|
name: ${{ matrix.os }}-smoke-test-screenshots-${{ github.run_number }}
|
|
|
|
path: packages/insomnia-smoke-test/screenshots
|