Repository navigation
240 lines (235 loc) · 10.8 KB
/
Copy pathclion-stable.yml
File metadata and controls
240 lines (235 loc) · 10.8 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: CLion stable runtime
on:
workflow_call:
inputs:
plugin_artifact:
type: string
required: true
workflow_dispatch:
inputs:
release_tag:
description: Published plugin release to install without rebuilding the backend (empty, the latest)
type: string
default: ''
# A new CLion is met by CI before a user meets it: the latest published plugin on the stable
# releases named below, every week.
schedule:
- cron: '17 4 * * 1'
permissions:
contents: read
env:
XLINGS_NON_INTERACTIVE: '1'
jobs:
runtime:
name: packaged plugin on CLion ${{ matrix.version }}
runs-on: ubuntu-24.04
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
version: ['2026.1.5.2', '2026.2.4.1']
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-mcpp
- name: Gradle and a virtual display
run: |
xlings install gradle -y -g
sudo apt-get update -qq
sudo apt-get install -y xvfb
- name: The compiler for actual build, run and test actions
run: |
mcpp toolchain install gcc 16.1.0
mcpp toolchain default gcc@16.1.0
- uses: actions/cache@v5
with:
path: ~/.gradle/caches/modules-2
key: clion-stable-runtime-${{ hashFiles('mide-plugins/clion/integration-tests/*.gradle.kts') }}
- name: The candidate ZIP built once by CI
if: inputs.plugin_artifact != ''
uses: actions/download-artifact@v5
with:
name: ${{ inputs.plugin_artifact }}
path: stable-plugin
- name: The published ZIP for an isolated release check
if: inputs.plugin_artifact == ''
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
# Unnamed (the weekly run): the newest release that carries the CLion plugin.
if [ -z "$RELEASE_TAG" ]; then
RELEASE_TAG="$(gh api "repos/$GITHUB_REPOSITORY/releases?per_page=100" --jq '[.[] | select((.draft | not) and (.tag_name | test("^(clion-)?v[0-9]+\\.[0-9]+\\.[0-9]+$")))][0].tag_name')"
fi
[[ "$RELEASE_TAG" =~ ^(clion-)?v[0-9]+\.[0-9]+\.[0-9]+$ ]]
mkdir -p stable-plugin
gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
--pattern 'mcpp-clion-*.zip' --dir stable-plugin
- name: The pinned language-service plugin
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
version="$(sed -n 's/^mcpplsPluginVersion *= *//p' mide-plugins/clion/gradle.properties)"
gh release download "v$version" --repo Sunrisepeak/mcpp-language-server \
--pattern "mcppls-clion-$version.zip" --dir stable-plugin
- name: Start the real IDE and complete the plugin startup chain
env:
IDE_VERSION: ${{ matrix.version }}
run: |
set -euo pipefail
plugin="$(find stable-plugin -maxdepth 1 -name 'mcpp-clion-*.zip' -print)"
language="$(find stable-plugin -maxdepth 1 -name 'mcppls-clion-*.zip' -print)"
test -n "$plugin" && test -n "$language"
# Ubuntu's userns AppArmor restriction prevents JCEF's sandbox from
# creating its browser. Permit userns only for this hosted UI check;
# Chromium/JCEF sandbox flags and the tests remain unchanged.
original=$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns)
[[ "$original" =~ ^[01]$ ]]
printf '%s\n' "$original" > "$RUNNER_TEMP/clion-userns-policy"
restore_userns_policy() {
local status=$?
trap - EXIT
if ! sudo sysctl -w "kernel.apparmor_restrict_unprivileged_userns=$original" >/dev/null ||
[ "$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns)" != "$original" ]; then
echo '::error::Could not restore the original user namespace policy'
exit 1
fi
exit "$status"
}
trap restore_userns_policy EXIT
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 >/dev/null
unshare -Ur true
xvfb-run -a gradle --no-daemon --max-workers=4 \
-p mide-plugins/clion/integration-tests test \
-PpluginZip="$GITHUB_WORKSPACE/$plugin" \
-PmcpplsZip="$GITHUB_WORKSPACE/$language" \
-PideVersion="$IDE_VERSION" \
-Poutput="$RUNNER_TEMP/clion-stable-result"
- name: Restore the hosted user namespace policy
if: always()
run: |
set -euo pipefail
state="$RUNNER_TEMP/clion-userns-policy"
if [ -f "$state" ]; then
original=$(cat "$state")
[[ "$original" =~ ^[01]$ ]]
sudo sysctl -w "kernel.apparmor_restrict_unprivileged_userns=$original" >/dev/null
test "$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns)" = "$original"
fi
# The report contains public versions and assertions only. Private user
# logs and arbitrary IDE process output are not uploaded as artifacts.
- uses: actions/upload-artifact@v5
if: always()
with:
name: clion-stable-${{ matrix.version }}
path: |
${{ runner.temp }}/clion-stable-result/result.json
${{ runner.temp }}/clion-stable-result/checks.json
${{ runner.temp }}/clion-stable-result/ide-errors*.ndjson
${{ runner.temp }}/clion-stable-result/settings/result.json
${{ runner.temp }}/clion-stable-result/settings/observations.json
${{ runner.temp }}/clion-stable-result/graphs/result.json
${{ runner.temp }}/clion-stable-result/graphs/checks.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef/result.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef/checks.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef/no-jcef-window.txt
${{ runner.temp }}/clion-stable-result/graphs-no-jcef-plugin/result.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef-plugin/checks.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef-plugin/no-jcef-window.txt
if-no-files-found: warn
# The report of #13 came from macOS on Apple silicon, where the JCEF plugin is a build of its own:
# the startup chain and the graphs (JCEF on, switched off, its plugin disabled) on the newest stable
# CLion there.
# One IDE per runner: on macOS a second IDE started on the same runner could stop at its start, before
# any plugin loads (its log ends at "CPU cores"), and its driver never connected.
runtime-macos:
name: packaged plugin on CLion ${{ matrix.version }} (macOS aarch64, ${{ matrix.scenario }})
runs-on: macos-15
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
version: ['2026.2.4.1']
scenario: [graphRendersNavigatesAndRecoversInJcef, graphExplainsAbsentJcefPlugin, graphExplainsUnavailableJcef]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-mcpp
with:
llvm: 'true'
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '25'
- uses: gradle/actions/setup-gradle@v5
with:
gradle-version: '9.7.1'
- name: The candidate ZIP built once by CI
if: inputs.plugin_artifact != ''
uses: actions/download-artifact@v5
with:
name: ${{ inputs.plugin_artifact }}
path: stable-plugin
- name: The published ZIP for an isolated release check
if: inputs.plugin_artifact == ''
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
if [ -z "$RELEASE_TAG" ]; then
RELEASE_TAG="$(gh api "repos/$GITHUB_REPOSITORY/releases?per_page=100" --jq '[.[] | select((.draft | not) and (.tag_name | test("^(clion-)?v[0-9]+\\.[0-9]+\\.[0-9]+$")))][0].tag_name')"
fi
[[ "$RELEASE_TAG" =~ ^(clion-)?v[0-9]+\.[0-9]+\.[0-9]+$ ]]
mkdir -p stable-plugin
gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
--pattern 'mcpp-clion-*.zip' --dir stable-plugin
- name: The pinned language-service plugin
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
version="$(sed -n 's/^mcpplsPluginVersion *= *//p' mide-plugins/clion/gradle.properties)"
gh release download "v$version" --repo Sunrisepeak/mcpp-language-server \
--pattern "mcppls-clion-$version.zip" --dir stable-plugin
- name: Start the real IDE, complete the startup chain and open the graphs
env:
IDE_VERSION: ${{ matrix.version }}
run: |
set -euo pipefail
plugin="$(find stable-plugin -maxdepth 1 -name 'mcpp-clion-*.zip' -print)"
language="$(find stable-plugin -maxdepth 1 -name 'mcppls-clion-*.zip' -print)"
test -n "$plugin" && test -n "$language"
gradle --no-daemon --max-workers=4 \
-p mide-plugins/clion/integration-tests test --tests "GraphInteractionTest.${{ matrix.scenario }}" \
-PpluginZip="$GITHUB_WORKSPACE/$plugin" \
-PmcpplsZip="$GITHUB_WORKSPACE/$language" \
-PideVersion="$IDE_VERSION" \
-Poutput="$RUNNER_TEMP/clion-stable-result"
- uses: actions/upload-artifact@v5
if: always()
with:
name: clion-stable-macos-${{ matrix.version }}-${{ matrix.scenario }}
# The JUnit results name an assertion's message; the IDE's own log, of a runner's IDE on a
# generated project, names why an IDE did not start.
path: |
${{ runner.temp }}/clion-stable-result/ide-errors*.ndjson
mide-plugins/clion/integration-tests/build/test-results/test/*.xml
out/ide-tests/tests/*/*/log/idea.log
out/ide-tests/tests/*/*/log/monitoring-thread-dumps-ide/*.txt
${{ runner.temp }}/clion-stable-result/*/ide-start-retried
${{ runner.temp }}/clion-stable-result/graphs/result.json
${{ runner.temp }}/clion-stable-result/graphs/checks.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef/result.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef/checks.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef/no-jcef-window.txt
${{ runner.temp }}/clion-stable-result/graphs-no-jcef-plugin/result.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef-plugin/checks.json
${{ runner.temp }}/clion-stable-result/graphs-no-jcef-plugin/no-jcef-window.txt
if-no-files-found: warn