Repository navigation
128 lines (122 loc) · 4.12 KB
/
Copy pathci.yml
File metadata and controls
128 lines (122 loc) · 4.12 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
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: 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
.artifacts/jdk-downloads
key: third-party-${{ hashFiles('third_party/*/manifest.json') }}
- 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: 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
- name: Restore checksum-verified downloads
uses: actions/cache@v4
with:
path: |
.artifacts/jdtls-downloads
.artifacts/jdk-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 language server
run: node scripts/package/smoke-linux.mjs dist/*-linux-${{ matrix.arch }}.zip
- 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