1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-20 22:07:31 +03:00
lens/.github/workflows/test.yml
Jari Kolehmainen 76c025f04c
Fix ensure-binaries bin (#7078)
* fix ensure-binaries bin

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix dist file extension

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* use type: module

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix lerna/yarn timeouts on windows

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* increase install dependency retry timeout

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

---------

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-02-01 17:13:13 +02:00

79 lines
2.5 KiB
YAML

name: Test
on:
pull_request:
branches:
- "**"
push:
branches:
- master
jobs:
test:
name: ${{ matrix.type }} tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
type: [unit, smoke]
node-version: [16.x]
steps:
- name: Checkout Release from lens
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
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-
- uses: nick-fields/retry@v2
name: Install dependencies
with:
timeout_minutes: 20
max_attempts: 3
retry_on: error
command: yarn install --frozen-lockfile
- run: yarn run test:unit
name: Run tests
if: ${{ matrix.type == 'unit' }}
- name: Install integration test dependencies
id: minikube
uses: medyagh/setup-minikube@master
with:
minikube-version: latest
if: ${{ runner.os == 'Linux' && matrix.type == 'smoke' }}
- run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' yarn run test:integration
name: Run Linux integration tests
if: ${{ runner.os == 'Linux' && matrix.type == 'smoke' }}
- run: yarn run test:integration
name: Run macOS integration tests
shell: bash
if: ${{ runner.os == 'macOS' && matrix.type == 'smoke' }}
- run: yarn run test:integration
name: Run Windows integration tests
if: ${{ runner.os == 'Windows' && matrix.type == 'smoke' }}