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:
|
2021-10-12 00:35:59 +00:00
|
|
|
get_version:
|
|
|
|
name: Get version
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
inso-version: ${{ steps.get-package-version.outputs.current-version }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
2022-02-02 11:11:13 +00:00
|
|
|
uses: actions/checkout@v2
|
2021-10-12 00:35:59 +00:00
|
|
|
- name: Get version
|
|
|
|
id: get-package-version
|
|
|
|
uses: martinbeentjes/npm-get-version-action@master
|
|
|
|
with:
|
|
|
|
path: packages/insomnia-inso
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2020-08-25 20:45:58 +00:00
|
|
|
OS:
|
2021-10-14 14:59:45 +00:00
|
|
|
needs: [get_version]
|
2020-08-25 20:45:58 +00:00
|
|
|
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-02-02 11:11:13 +00:00
|
|
|
uses: actions/checkout@v2
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-10-12 00:10:09 +00:00
|
|
|
- name: Setup Node
|
2022-02-09 16:35:34 +00:00
|
|
|
uses: actions/setup-node@v2
|
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
|
|
|
|
run: npm run app-build:smoke
|
|
|
|
|
|
|
|
- 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: |
|
2021-10-12 00:35:59 +00:00
|
|
|
INSO_VERSION="${{ needs.get_version.outputs.inso-version }}-run.${{ github.run_number }}"
|
|
|
|
PKG_NAME="inso-${{ matrix.os }}-$INSO_VERSION"
|
2021-10-14 22:16:30 +00:00
|
|
|
BUNDLE_ID="com.insomnia.inso"
|
2021-10-12 00:10:09 +00:00
|
|
|
|
|
|
|
echo ::set-output name=pkg-name::$PKG_NAME
|
|
|
|
echo ::set-output name=bundle-id::$BUNDLE_ID
|
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
|
2021-10-06 22:01:43 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
if-no-files-found: ignore
|
|
|
|
name: ${{ matrix.os }}-smoke-test-screenshots-${{ github.run_number }}
|
|
|
|
path: packages/insomnia-smoke-test/screenshots
|