Repository navigation
215 lines (209 loc) · 8.63 KB
/
Copy pathmain.yml
File metadata and controls
215 lines (209 loc) · 8.63 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: main
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
inputs:
prerelease-date:
description: UTC date for the Marketplace pre-release (YYYY-MM-DD)
type: string
default: ''
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
env:
VSCR_REQUIRE_PLOT_TESTS: '1'
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: r-lib/actions/setup-r@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2
with:
use-public-rspm: true
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Verify sess source identity and bootstrap
run: pnpm run test:sess-source
- name: Verify managed tool library
run: pnpm run test:tool-library
- name: Verify managed tool consent
run: pnpm run test:tool-consent
- name: Install R test dependencies
uses: r-lib/actions/setup-r-dependencies@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2
with:
working-directory: sess
# Keep Suggests for live plot tests. Install lintr/styler explicitly
# for Interactive tests; they are optional languageserver dependencies.
# renv is exercised by the Interactive library-isolation tests.
extra-packages: |
any::remotes
any::pkgbuild
any::languageserver
any::lintr
any::styler
any::renv
- run: pnpm run compile
- name: Install bundled sess with prepared dependencies
run: remotes::install_local('dist/resources/sess', dependencies = FALSE, upgrade = 'never', force = TRUE)
shell: Rscript {0}
- name: Verify live plot lifecycle dependencies
run: |
packages <- c("processx", "later", "jsonlite", "jgd", "httpgd", "svglite")
for (package in packages) {
message("Loading plot test dependency: ", package)
loadNamespace(package)
}
stopifnot(packageVersion("httpgd") >= "2.0.1")
shell: Rscript {0}
- name: Verify managed jgd preparation
run: pnpm run test:prepare-jgd
- name: Verify managed rstudioapi preparation
run: pnpm run test:prepare-rstudioapi
- name: Verify installed sess identity
run: |
source("R/sess_source.R")
stopifnot(!sess_install_required("dist/resources/sess"))
shell: Rscript {0}
- name: Run sess tests
run: tinytest::test_package("sess")
shell: Rscript {0}
- name: Compile test files
run: pnpm run clean && pnpm exec tsc
- name: Install arf binary for Interactive tests
if: runner.os != 'Windows'
shell: bash
run: |
ARF_ARCH="$(uname -m)"
if [ "${ARF_ARCH}" = "arm64" ]; then ARF_ARCH="aarch64"; fi
if [ "${{ runner.os }}" = "macOS" ]; then
ARF_TARGET="${ARF_ARCH}-apple-darwin"
else
ARF_TARGET="${ARF_ARCH}-unknown-linux-gnu"
fi
ARF_ARCHIVE="arf-console-${ARF_TARGET}.tar.xz"
ARF_RELEASE="https://github.com/eitsupi/arf/releases/download/v0.5.3"
curl -fsSL "${ARF_RELEASE}/${ARF_ARCHIVE}" -o "${RUNNER_TEMP}/${ARF_ARCHIVE}"
curl -fsSL "${ARF_RELEASE}/sha256.sum" -o "${RUNNER_TEMP}/arf.sha256"
(cd "${RUNNER_TEMP}" && awk -v name="${ARF_ARCHIVE}" '$2 == name || $2 == "*" name' arf.sha256 > arf-selected.sha256 && test -s arf-selected.sha256 && shasum -a 256 -c arf-selected.sha256)
mkdir -p "${RUNNER_TEMP}/arf"
tar -xJf "${RUNNER_TEMP}/${ARF_ARCHIVE}" -C "${RUNNER_TEMP}/arf"
ARF_EXECUTABLE=$(find "${RUNNER_TEMP}/arf" -type f -name arf | head -n 1)
test -n "${ARF_EXECUTABLE}"
echo "$(dirname "${ARF_EXECUTABLE}")" >> "$GITHUB_PATH"
echo "ARF_PATH=${ARF_EXECUTABLE}" >> "$GITHUB_ENV"
- name: Test persistent tmux sessions (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y tmux
VSCR_TEST_TMUX=1 pnpm exec mocha out/test/node/interactiveRuntime.test.js --ui tdd --timeout 60000 --grep "^Interactive real R runtime standalone agent survives its launcher process exiting$"
- name: Run Node tests including live plot lifecycle tests
run: pnpm run test:node
- name: Run plot lifecycle extension tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a pnpm run test:extension --label plot-lifecycle
- name: Run plot lifecycle extension tests
if: runner.os != 'Linux'
run: pnpm run test:extension --label plot-lifecycle
- name: Run extension tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a pnpm run test:extension --label provider-tests --label editor-command-tests --label interactive-integration
- name: Run extension tests
if: runner.os != 'Linux'
run: pnpm run test:extension --label provider-tests --label editor-command-tests --label interactive-integration
- name: Preserve extension test failure logs
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: extension-test-logs-${{ runner.os }}
path: |
.vscode-test/user-data/**/logs/**/exthost/exthost.log
.vscode-test/user-data/**/logs/**/exthost/output_logging_*/*.log
retention-days: 7
build:
runs-on: ubuntu-latest
env:
VSIX_FILE: vscode-R.vsix
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Test extension versioning
run: node --test .github/scripts/extension-version.test.js
- name: Set Marketplace pre-release version
if: inputs.prerelease-date
env:
PRERELEASE_DATE: ${{ inputs.prerelease-date }}
run: node .github/scripts/extension-version.js prerelease "$PRERELEASE_DATE"
- name: Package Marketplace pre-release
if: inputs.prerelease-date
run: pnpm exec vsce package --pre-release --no-dependencies -o $VSIX_FILE
- name: Package extension
if: ${{ !inputs.prerelease-date }}
run: pnpm exec vsce package --no-dependencies -o $VSIX_FILE
- name: Verify packaged sess identity
run: node .github/scripts/verify-sess-vsix.js
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ env.VSIX_FILE }}
path: ${{ env.VSIX_FILE }}
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Check TypeScript formatting
run: pnpm run format:check
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: r-lib/actions/setup-r@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2
with:
use-public-rspm: true
- name: Install lintr
run: install.packages("lintr")
shell: Rscript {0}
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Lint TypeScript
run: pnpm run lint
- name: Lint R directory
run: lintr::lint_dir("./R")
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
- name: Lint root directory
run: lintr::lint_package("sess")
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true