-
Notifications
You must be signed in to change notification settings - Fork 239
120 lines (116 loc) · 3.12 KB
/
apklab.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build-and-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name:
- lint
- linux-build-test
- macos-build-test
- windows-build-test
- node20-build
include:
- name: lint
os: ubuntu-22.04
node: 18
- name: linux-build-test
os: ubuntu-22.04
node: 18
run_test: true
- name: macos-build-test
os: macos-14
node: 18
run_test: true
- name: windows-build-test
os: windows-latest
node: 18
run_test: true
- name: node20-build
os: ubuntu-22.04
node: 20
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Linter
if: matrix.name == 'lint'
run: yarn lint
- name: Package extension
if: matrix.name != 'lint'
run: yarn package
- name: Setup python 3.11
if: matrix.run_test == true
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install quark-engine
continue-on-error: true
if: matrix.run_test == true
shell: bash
run: |
pip install -U quark-engine
# get quark-engine rules
freshquark
# check if it installed properly
quark --help
quark -a testdata/simplekeyboard/test.apk -s
- name: Run tests
if: matrix.run_test == true
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
xvfb-run -a yarn test
elif [ "$RUNNER_OS" == "Windows" ]; then
yarn test || true
else
yarn test
fi
- uses: actions/upload-artifact@v4
if: matrix.name == 'linux-build-test'
with:
name: apklab.vsix
path: apklab*.vsix
release:
name: release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Package extension
run: yarn package
- name: Release [open-vsx]
run: |
yarn add ovsx
yarn ovsx publish apklab*.vsix -p ${{ secrets.OPEN_VSX_TOKEN }}
- name: Release [marketplace]
run: yarn vsce publish -p ${{ secrets.VS_MARKETPLACE_TOKEN }} --yarn