-
Notifications
You must be signed in to change notification settings - Fork 656
179 lines (159 loc) · 6.38 KB
/
pr.yml
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
name: pr
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
# Cancel any current or previous job from the same PR
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
tests-gradle:
if: "!startsWith(github.head_ref, 'release-')"
runs-on: macos-14
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 #v4.0.0
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/gradle-build-action@42452daeb5b454a76f686a8e4de8234afd7b1f44 #v2.12.0
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew ciTestsGradle
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
if: always()
with:
name: tests-gradle.zip
path: diagnostics.zip
tests-no-gradle:
if: "!startsWith(github.head_ref, 'release-')"
runs-on: macos-14
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 #v4.0.0
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/gradle-build-action@42452daeb5b454a76f686a8e4de8234afd7b1f44 #v2.12.0
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew ciTestsNoGradle --stacktrace
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
if: always()
with:
name: tests-no-gradle.zip
path: diagnostics.zip
tests-integration:
if: "!startsWith(github.head_ref, 'release-')"
runs-on: macos-14
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 #v4.0.0
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/gradle-build-action@42452daeb5b454a76f686a8e4de8234afd7b1f44 #v2.12.0
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew -p tests ciBuild
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
if: always()
with:
name: tests-integration.zip
path: diagnostics.zip
intellij-plugin:
if: "!startsWith(github.head_ref, 'release-')"
name: Build IntelliJ Plugin
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 #v4.0.0
with:
distribution: 'temurin'
java-version: 17
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew :intellij-plugin:properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
echo "::set-output name=version::$VERSION"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
./gradlew :intellij-plugin:listProductsReleases # prepare list of IDEs for Plugin Verifier
# Trigger code generation in test project, as the plugin's tests depend on it
- name: Test project codegen
run: ./gradlew -p tests :intellij-plugin-test-project:generateApolloSources
# Run tests
- name: Run Tests
run: ./gradlew :intellij-plugin:check
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
with:
name: tests-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/tests
# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 #v4.0.0
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('intellij-plugin/build/listProductsReleases.txt') }}
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew :intellij-plugin:runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/pluginVerifier
# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/intellij-plugin/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "::set-output name=filename::${FILENAME:0:-4}"
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./intellij-plugin/build/distributions/content/*/*