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
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- synchronize
|
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
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- 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
|
|
|
|
uses: actions/checkout@v1
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2020-07-28 05:18:26 +00:00
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
2021-10-14 14:59:45 +00:00
|
|
|
|
2021-10-12 00:10:09 +00:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v1
|
2020-04-26 20:33:39 +00:00
|
|
|
with:
|
2020-07-28 05:18:26 +00:00
|
|
|
node-version: ${{ steps.nvm.outputs.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
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
- name: Codesign & create macOS installer
|
2021-10-12 00:10:09 +00:00
|
|
|
if: matrix.os == 'macos-latest'
|
|
|
|
run: |
|
|
|
|
chmod +x ./src/scripts/macos-pkg.sh
|
|
|
|
./src/scripts/macos-pkg.sh
|
|
|
|
shell: bash
|
|
|
|
working-directory: packages/insomnia-inso
|
|
|
|
continue-on-error: true
|
|
|
|
env:
|
|
|
|
MACOS_CERTIFICATE: ${{ secrets.DESIGNER_MAC_CSC_LINK }}
|
|
|
|
MACOS_CERTIFICATE_PWD: ${{ secrets.DESIGNER_MAC_CSC_KEY_PASSWORD }}
|
|
|
|
PKG_NAME: ${{ steps.inso-variables.outputs.pkg-name }}
|
|
|
|
BUNDLE_ID: ${{ steps.inso-variables.outputs.bundle-id }}
|
2021-10-12 00:35:59 +00:00
|
|
|
VERSION: ${{ steps.inso-variables.outputs.inso-version }}
|
2021-10-12 00:10:09 +00:00
|
|
|
|
|
|
|
# We don't need to notarize and staple on every commit
|
2021-10-14 22:16:30 +00:00
|
|
|
# - name: Notarize installer
|
2021-10-12 00:10:09 +00:00
|
|
|
# if: matrix.os == 'macos-latest'
|
|
|
|
# uses: devbotsxyz/xcode-notarize@v1
|
|
|
|
# with:
|
2021-10-12 21:23:25 +00:00
|
|
|
# product-path: packages/insomnia-inso/artifacts/${{ steps.inso-variables.outputs.pkg-name }}.pkg
|
2021-10-12 00:10:09 +00:00
|
|
|
# primary-bundle-id: ${{ steps.inso-variables.outputs.bundle-id }}
|
|
|
|
# appstore-connect-username: ${{ secrets.DESIGNER_APPLE_ID }}
|
|
|
|
# appstore-connect-password: ${{ secrets.DESIGNER_APPLE_ID_PASSWORD }}
|
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
# - name: Staple installer
|
2021-10-12 00:10:09 +00:00
|
|
|
# if: matrix.os == 'macos-latest'
|
|
|
|
# uses: devbotsxyz/xcode-staple@v1
|
|
|
|
# with:
|
2021-10-12 21:23:25 +00:00
|
|
|
# product-path: packages/insomnia-inso/artifacts/${{ steps.inso-variables.outputs.pkg-name }}.pkg
|
2021-10-12 00:10:09 +00:00
|
|
|
|
2021-10-14 22:16:30 +00:00
|
|
|
# - name: Notarize binary
|
|
|
|
# if: matrix.os == 'macos-latest'
|
|
|
|
# uses: devbotsxyz/xcode-notarize@v1
|
|
|
|
# with:
|
|
|
|
# product-path: packages/insomnia-inso/binaries/inso
|
|
|
|
# primary-bundle-id: ${{ steps.inso-variables.outputs.bundle-id }}-binary
|
|
|
|
# appstore-connect-username: ${{ secrets.DESIGNER_APPLE_ID }}
|
|
|
|
# appstore-connect-password: ${{ secrets.DESIGNER_APPLE_ID_PASSWORD }}
|
|
|
|
|
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
|