-
Notifications
You must be signed in to change notification settings - Fork 49
80 lines (67 loc) · 1.98 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-test-matrix.outputs.matrix }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint codebase
run: npm run lint
- name: Build extension
run: npm run build
- name: Pack extension
run: mkdir out && npm pack --pack-destination out
- name: Save extension pack
uses: actions/cache/save@v3
with:
path: out
key: pack-${{ github.run_id }}
- name: Generate test matrix
id: generate-test-matrix
env:
TEST_CONSTRAINTS: |
["~6.4.0", "~6.3.0"]
TEST_HEAD_REF: '0'
run: |
echo "matrix=$(node tools/generate_test_matrix.js)" >> $GITHUB_OUTPUT
integration:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJSON(needs.build.outputs.matrix) }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up minikube
uses: medyagh/setup-minikube@latest
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Restore extension pack
uses: actions/cache/restore@v3
with:
path: out
key: pack-${{ github.run_id }}
- name: Run integration test
run: |-
EXTENSION_PATH="$(realpath out/$(ls -1 out))" LENS_REF="${{ matrix.lens-ref }}" xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' tools/integration_test.sh