-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 3.29 KB
/
Copy pathci-phpstorm-plugin.yml
File metadata and controls
100 lines (88 loc) · 3.29 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
name: PhpStorm Plugin CI
on:
pull_request:
push:
branches: [main]
# Per-workflow concurrency. See ci-core.yml for the rationale.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
gradle-build:
name: Gradle build (PhpStorm plugin)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v6
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
# Cache key is built from the wrapper version + build script
# hash, so this stays warm across PRs that don't touch the plugin
# build config.
gradle-home-cache-cleanup: true
- name: Build plugin (compile + test)
# `make build` from this directory is `./gradlew build`, which runs
# compileKotlin, test, and packages the plugin jar via the
# IntelliJ Platform Gradle Plugin's `composedJar` task.
#
# The build's downloadLspPhar task fetches the xphp LSP binary from
# `xphpLspPharUrl` in gradle.properties and bundles it at
# bin/xphp-lsp.phar. The build FAILS if that property is unset/empty
# -- by design, so a jar never ships without an embedded LSP.
run: make build
- name: Upload plugin jar
uses: actions/upload-artifact@v4
with:
name: xphp-phpstorm-plugin-jar
path: build/libs/xphp-phpstorm-plugin-*.jar
if-no-files-found: error
retention-days: 14
- name: Upload test reports on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: phpstorm-plugin-test-reports
path: |
build/reports/tests/
build/test-results/
if-no-files-found: ignore
retention-days: 14
verify-plugin:
name: Plugin Verifier (PhpStorm plugin)
runs-on: ubuntu-latest
needs: gradle-build
steps:
- uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run IntelliJ Plugin Verifier
# `verifyPlugin` checks binary compatibility across the IDE matrix
# declared in build.gradle.kts `pluginVerification.ides {}` -- the
# `recommended()` set for since-build 261. A failure here means a
# platform API we depend on changed shape between IDE builds.
#
# The verifier itself doesn't read the PHAR, but Gradle's build graph
# treats `processResources` (which downloads + bundles the PHAR from
# `xphpLspPharUrl` in gradle.properties) as a prerequisite of
# `verifyPlugin`, so the property must be set or the build aborts
# before the verifier runs.
run: make verify
- name: Upload Plugin Verifier reports on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: phpstorm-plugin-verifier-reports
path: build/reports/pluginVerifier/
if-no-files-found: ignore
retention-days: 14