Repository navigation
130 lines (128 loc) · 4.21 KB
/
Copy pathci_extension_test.yml
File metadata and controls
130 lines (128 loc) · 4.21 KB
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
121
122
123
124
125
126
127
128
129
130
name: "CI: Extension test"
on:
workflow_dispatch:
workflow_call:
inputs:
wheels:
description: 'Test the packages made from the `dist` artifact of the calling run'
type: boolean
default: false
outputs:
prerelease_flag:
description: '"--pre-release" if dev version, empty string otherwise'
value: ${{ jobs.build_extension.outputs.prerelease_flag }}
push:
branches: [ main ]
paths:
- '**/*'
- '!.*'
- '.github/workflows/ci_extension_build.yml'
- '.github/workflows/ci_extension_test.yml'
# Narrower than the push trigger above, because a pull request pays for the
# whole nine-platform binary build before any test runs. Server changes are
# already covered per pull request by the Rust and Scrut suites in
# ci_pyrefly.yml; what only this workflow can check is the extension itself,
# against the packaged VSIX.
pull_request:
paths:
- 'lsp/**'
- '.github/workflows/ci_extension_build.yml'
- '.github/workflows/ci_extension_test.yml'
jobs:
build_extension:
uses: ./.github/workflows/ci_extension_build.yml
with:
wheels: ${{ inputs.wheels || false }}
test_extension:
needs: build_extension
if: success()
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
- os: windows-11-arm
platform: win32
arch: arm64
- os: ubuntu-latest
platform: linux
arch: x64
- os: ubuntu-24.04-arm
platform: linux
arch: arm64
# GitHub's ARM64 runners cannot run 32-bit ARM code, so the ARMv7
# executable runs through QEMU instead.
- os: ubuntu-latest
platform: linux
arch: armhf
- os: ubuntu-latest
platform: alpine
arch: x64
- os: ubuntu-24.04-arm
platform: alpine
arch: arm64
- os: macos-15-intel
platform: darwin
arch: x64
- os: macos-15
platform: darwin
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo (to see version.bzl in next step)
uses: actions/checkout@v6
with:
fetch-depth: 0 # Get all history for all branches and tags
- name: download built vsix
uses: actions/download-artifact@v7
with:
name: pyrefly-${{ matrix.platform }}-${{ matrix.arch }}
- name: Rename .vsix to .zip
run: |
mv *.vsix *.zip
shell: bash
- name: Extract .zip file
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
powershell -Command "Expand-Archive -Path *.zip -DestinationPath extracted"
else
unzip *.zip -d extracted
fi
shell: bash
- name: Copy extracted files to lsp/bin
run: |
mkdir -p lsp/bin && mv extracted/extension/bin/* lsp/bin/
shell: bash
- name: Set up QEMU for the ARMv7 executable
if: ${{ matrix.arch == 'armhf' }}
run: |
sudo apt-get -o Acquire::Retries=3 update
sudo apt-get -o Acquire::Retries=3 install --yes --no-install-recommends qemu-user-binfmt libc6-armhf-cross libgcc-s1-armhf-cross
echo "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf" >> "$GITHUB_ENV"
# Now run the test
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- run: npm ci
working-directory: lsp/
- run: npm run compile
working-directory: lsp/
- name: Run single-root extension tests
run: bash ./run_extension_tests.sh single-root
shell: bash
working-directory: lsp/
- name: Run multi-root extension tests
run: bash ./run_extension_tests.sh multi-root
shell: bash
working-directory: lsp/
- name: Run no-folders extension tests
run: bash ./run_extension_tests.sh no-folders
shell: bash
working-directory: lsp/
- name: Run failed-start extension tests
run: bash ./run_extension_tests.sh failed-start
shell: bash
working-directory: lsp/