Repository navigation
164 lines (158 loc) · 6.28 KB
/
Copy pathmain.yml
File metadata and controls
164 lines (158 loc) · 6.28 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
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:
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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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: Install R test dependencies
run: install.packages(c("remotes", "pkgbuild", "languageserver", "lintr", "renv"))
shell: Rscript {0}
- run: pnpm run build
- 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
run: pnpm run test:node
- name: Run extension tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a pnpm run test:extension
- name: Run extension tests
if: runner.os != 'Linux'
run: pnpm run test:extension
- name: Preserve extension test failure logs
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.VSIX_FILE }}
path: ${{ env.VSIX_FILE }}
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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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