Repository navigation
228 lines (220 loc) · 8.27 KB
/
Copy pathci.yml
File metadata and controls
228 lines (220 loc) · 8.27 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
name: CI
# Draft pull requests only run the Linux checks. The macOS package job starts
# when a pull request is ready for review and on every push to main.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
rust:
name: Rust checks and tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Test package resources
run: node --test --test-timeout=60000 scripts/package/*.test.mjs
- name: Test bounded integration tool cleanup
run: node --test --test-timeout=15000 scripts/compiler/process.test.mjs
- name: Check formatting
run: cargo fmt --all --check
- name: Lint
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Test
run: cargo test --workspace --locked
- name: Check the pinned plugin SDK release
run: scripts/verify-sdk-lock.sh --download
package:
name: Build and verify the macOS packages
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: macos-26
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
# scripts/assemble-package.sh compiles the plugin backend for each
# architecture it packages.
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin, x86_64-apple-darwin
# Downloads are named by their SHA-256 and verified again before use.
- name: Restore verified third-party downloads
uses: actions/cache@v4
with:
path: .artifacts/jdtls-downloads
key: third-party-${{ hashFiles('third_party/*/manifest.json') }}
# The package ships no JDK. This one compiles the plugin's own JDT LS
# extension bundle while packaging, and the integration tests run the
# tested JDT LS release on it, as a user's JDK 21+ would.
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- name: Build, verify and archive both architectures
run: |
set -euo pipefail
for arch in arm64 x86_64; do
package=$(scripts/build-package.sh --arch "$arch")
scripts/archive-package.sh --package "$package" --arch "$arch"
done
- name: Verify native compiler settings and JARs with the user's JDT LS
run: |
package=".artifacts/package/$(uname -m)/io.github.lithe-idea.java-support"
node scripts/compiler/test-live.mjs "$package"
LITHE_JAVA_PROJECT_KIND=eclipse node scripts/compiler/test-live.mjs "$package"
node scripts/compiler/test-project-models.mjs "$package"
node scripts/compiler/test-module-structure.mjs "$package"
- name: Upload native compiler projections
uses: actions/upload-artifact@v4
with:
name: native-compiler-projection
path: .artifacts/compiler/visual-*.json
if-no-files-found: error
- name: Upload the archives
uses: actions/upload-artifact@v4
with:
name: java-support-archives
path: dist/
retention-days: 7
if-no-files-found: error
linux:
name: Build and run Linux ${{ matrix.arch }} package
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
arch: x64
- os: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install packaging tools
run: sudo apt-get update && sudo apt-get install -y zsh zip unzip
# The package ships no JDK; the integration tests run the tested JDT LS
# release on this one, as a user's JDK 21+ would.
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- name: Restore checksum-verified downloads
uses: actions/cache@v4
with:
path: .artifacts/jdtls-downloads
key: linux-${{ matrix.arch }}-${{ hashFiles('third_party/*/manifest.json') }}
- name: Test the native backend
run: cargo test --workspace --locked
- name: Build and verify the archive
run: node scripts/package/build-linux.mjs "${{ matrix.arch }}"
- name: Start the packaged backend and the user's language server
run: node scripts/package/smoke-linux.mjs dist/*-linux-${{ matrix.arch }}.zip
- name: Compile legacy and cross-IDE project models with the user's language server
run: |
package=$(mktemp -d)
unzip -q dist/*-linux-${{ matrix.arch }}.zip -d "$package"
node scripts/compiler/test-project-models.mjs "$package/io.github.lithe-idea.java-support"
node scripts/compiler/test-module-structure.mjs "$package/io.github.lithe-idea.java-support"
rm -rf "$package"
- uses: actions/upload-artifact@v4
with:
name: java-linux-${{ matrix.arch }}
path: |
dist/*-linux-*.zip
dist/*-linux-*.zip.sha256
if-no-files-found: error
retention-days: 7
jsp-grammar-host:
# Runs on drafts too: it needs neither the Rust Core nor a package, only the
# host's pure-Go editor packages.
name: JSP grammar on the host tokenizer
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Read pinned host revision
id: host
run: echo "revision=$(node -p 'JSON.parse(require("fs").readFileSync("grammar-host.json")).revision')" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: 1lck/Lithe-IDEA
ref: ${{ steps.host.outputs.revision }}
path: .artifacts/grammar-host
sparse-checkout: desktop
persist-credentials: false
- uses: actions/setup-go@v5
with:
go-version-file: .artifacts/grammar-host/desktop/go.mod
cache: false
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Tokenize JSP with the host's TextMate engine
run: node scripts/grammar/host-jsp.mjs .artifacts/grammar-host
native-settings-visual:
name: Native compiler settings screenshots
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
needs: package
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: native-compiler-projection
path: .artifacts/compiler
- name: Read pinned host revision
id: host
run: echo "revision=$(node -p 'JSON.parse(require("fs").readFileSync("compiler-host.json")).revision')" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: 1lck/Lithe-IDEA
ref: ${{ steps.host.outputs.revision }}
path: .artifacts/host
- uses: actions/setup-go@v5
with:
go-version-file: .artifacts/host/desktop/go.mod
cache: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.100.0
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Render actual compiler projections through the native host
run: node scripts/compiler/visual.mjs .artifacts/host
- uses: actions/upload-artifact@v4
with:
name: native-compiler-settings-screenshots
path: .artifacts/compiler/visual/
if-no-files-found: error
retention-days: 14