2021-04-12 15:43:45 +03:00
|
|
|
name: Test
|
|
|
|
on:
|
2021-04-15 14:40:49 +03:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-09-16 17:38:31 +03:00
|
|
|
- "**"
|
2021-04-15 14:40:49 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-04-12 15:43:45 +03:00
|
|
|
jobs:
|
2022-10-05 00:20:21 +03:00
|
|
|
test:
|
|
|
|
name: ${{ matrix.type }} tests on ${{ matrix.os }}
|
2021-04-12 15:43:45 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2022-08-25 16:49:21 +03:00
|
|
|
fail-fast: false
|
2021-04-12 15:43:45 +03:00
|
|
|
matrix:
|
2022-08-23 17:15:30 +03:00
|
|
|
os: [ubuntu-20.04, macos-11, windows-2019]
|
2022-10-05 00:20:21 +03:00
|
|
|
type: [unit, smoke]
|
2022-06-08 09:55:17 +03:00
|
|
|
node-version: [16.x]
|
2021-04-12 15:43:45 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout Release from lens
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2021-04-16 13:40:51 +03:00
|
|
|
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: |
|
|
|
|
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
|
|
|
|
|
2021-04-12 15:43:45 +03:00
|
|
|
- name: Using Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
2021-04-13 12:26:36 +03:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
|
2022-02-16 19:33:08 +03:00
|
|
|
- uses: nick-fields/retry@v2
|
2021-04-12 15:43:45 +03:00
|
|
|
name: Install dependencies
|
2021-04-15 15:22:55 +03:00
|
|
|
with:
|
|
|
|
timeout_minutes: 10
|
|
|
|
max_attempts: 3
|
|
|
|
retry_on: error
|
|
|
|
command: make node_modules
|
2021-04-12 15:43:45 +03:00
|
|
|
|
|
|
|
- run: make test
|
|
|
|
name: Run tests
|
2022-10-05 00:20:21 +03:00
|
|
|
if: ${{ matrix.type == 'unit' }}
|
2021-04-12 15:43:45 +03:00
|
|
|
|
|
|
|
- run: make test-extensions
|
|
|
|
name: Run In-tree Extension tests
|
2022-10-05 00:20:21 +03:00
|
|
|
if: ${{ matrix.type == 'unit' }}
|
2021-04-12 15:43:45 +03:00
|
|
|
|
2022-04-27 06:18:18 +03:00
|
|
|
- run: make ci-validate-dev
|
2022-10-05 00:20:21 +03:00
|
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') && matrix.type == 'unit' }}
|
2022-04-27 06:18:18 +03:00
|
|
|
name: Validate dev mode will work
|
|
|
|
|
2021-09-16 16:02:43 +03:00
|
|
|
- name: Install integration test dependencies
|
|
|
|
id: minikube
|
2022-05-18 21:11:56 +03:00
|
|
|
uses: medyagh/setup-minikube@master
|
|
|
|
with:
|
|
|
|
minikube-version: latest
|
2022-10-05 00:20:21 +03:00
|
|
|
if: ${{ runner.os == 'Linux' && matrix.type == 'smoke' }}
|
2021-07-06 15:38:49 +03:00
|
|
|
|
|
|
|
- run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration
|
2021-04-12 15:43:45 +03:00
|
|
|
name: Run Linux integration tests
|
2022-10-05 23:32:10 +03:00
|
|
|
if: ${{ runner.os == 'Linux' && matrix.type == 'smoke' }}
|
2021-04-12 15:43:45 +03:00
|
|
|
|
2021-07-06 15:38:49 +03:00
|
|
|
- run: make integration
|
2021-08-31 11:00:27 +03:00
|
|
|
name: Run macOS integration tests
|
2021-04-12 15:43:45 +03:00
|
|
|
shell: bash
|
2021-08-31 11:00:27 +03:00
|
|
|
env:
|
|
|
|
ELECTRON_BUILDER_EXTRA_ARGS: "--x64 --arm64"
|
2022-10-05 00:20:21 +03:00
|
|
|
if: ${{ runner.os == 'macOS' && matrix.type == 'smoke' }}
|
2021-08-31 08:30:02 +03:00
|
|
|
|
2021-08-31 11:00:27 +03:00
|
|
|
- run: make integration
|
|
|
|
name: Run Windows integration tests
|
2021-08-31 08:30:02 +03:00
|
|
|
shell: bash
|
|
|
|
env:
|
2021-08-31 11:00:27 +03:00
|
|
|
ELECTRON_BUILDER_EXTRA_ARGS: "--x64 --ia32"
|
2022-10-05 00:20:21 +03:00
|
|
|
if: ${{ runner.os == 'Windows' && matrix.type == 'smoke' }}
|