-
Notifications
You must be signed in to change notification settings - Fork 13
107 lines (88 loc) · 2.91 KB
/
test.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
name: test
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
- name: 🏗 Setup project
uses: ./.github/actions/setup-project
- name: ✅ Lint project
run: npm run lint -- --max-warnings 0
scripts:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
- name: 🏗 Setup project
uses: ./.github/actions/setup-project
- name: 🧪 Test scripts
run: npm run test:scripts
bundled:
# This extension is bundled before publishing to the stores,
# it removes the need for vscode to download dependencies, making install fast.
# But this version might cause issues with webpack "hijacking" `require` statements.
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
- name: 🏗 Setup project
uses: ./.github/actions/setup-project
with:
with-fixture: true
- name: 👷 Build tests
run: npm run build
- name: 📦 Bundle extension
run: npm run build:production
# When bundled, these dependencies aren't available in normal environments.
# This drops all "dependencies" from the project, to only rely on the bundle itself.
- name: 🧹 Remove bundled dependencies
run: |
echo "$(jq 'del(.dependencies)' package.json)" > package.json
npm install --no-package-lock --ignore-scripts
- name: 🧪 Test project
uses: ./.github/actions/test-vscode
with:
command: npm run test:vscode
env:
VSCODE_VERSION: stable
vscode:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
vscode: [oldest, stable, insiders]
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
- name: 🏗 Setup project
uses: ./.github/actions/setup-project
with:
with-fixture: true
- name: 👷 Build project
run: npm run build
# This handles the "oldest" vscode version by looking up our "oldest supported version"
- name: 🕵️ Set vscode version
uses: actions/github-script@v7
with:
script: |
const { engines } = require('./package.json')
const vscode = '${{ matrix.vscode }}'
const target = vscode === 'oldest'
? engines.vscode.substring(1)
: vscode
core.exportVariable('VSCODE_VERSION', target)
- name: 🧪 Test project
uses: ./.github/actions/test-vscode
with:
command: npm run test:vscode