Skip to content

Commit 319eea9

Browse files
committed
Add CI jobs
1 parent b3a0212 commit 319eea9

File tree

4 files changed

+239
-0
lines changed

4 files changed

+239
-0
lines changed
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Build and verify
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
env:
8+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
9+
10+
# Cancel any current or previous job from the same PR
11+
concurrency:
12+
group: ${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
17+
# Prepare environment and build the plugin
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
outputs:
22+
version: ${{ steps.properties.outputs.version }}
23+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
24+
steps:
25+
26+
# Check out the current repository
27+
- name: Fetch Sources
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
29+
30+
# Set up Java environment for the next steps
31+
- name: Setup Java
32+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
33+
with:
34+
distribution: temurin
35+
java-version: 23
36+
37+
# Setup Gradle
38+
- name: Setup Gradle
39+
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 #v4.4.1
40+
41+
# Set environment variables
42+
- name: Export Properties
43+
id: properties
44+
shell: bash
45+
run: |
46+
PROPERTIES="$(./gradlew :plugin:properties --console=plain -q)"
47+
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
48+
49+
echo "version=$VERSION" >> $GITHUB_OUTPUT
50+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
51+
52+
# Build plugin
53+
- name: Build plugin
54+
run: ./gradlew buildPlugin
55+
56+
# Prepare plugin archive content for creating artifact
57+
- name: Prepare Plugin Artifact
58+
id: artifact
59+
shell: bash
60+
run: |
61+
cd ${{ github.workspace }}/plugin/build/distributions
62+
FILENAME=`ls *.zip`
63+
unzip "$FILENAME" -d content
64+
65+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
66+
67+
# Store already-built plugin as an artifact for downloading
68+
- name: Upload artifact
69+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
70+
with:
71+
name: ${{ steps.artifact.outputs.filename }}
72+
path: ./intellij-plugin/build/distributions/content/*/*
73+
74+
# Run tests and upload a code coverage report
75+
test:
76+
name: Test
77+
needs: [ build ]
78+
runs-on: ubuntu-latest
79+
steps:
80+
81+
# Check out the current repository
82+
- name: Fetch Sources
83+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
84+
85+
# Set up Java environment for the next steps
86+
- name: Setup Java
87+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
88+
with:
89+
distribution: temurin
90+
java-version: 23
91+
92+
# Setup Gradle
93+
- name: Setup Gradle
94+
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 #v4.4.1
95+
96+
# Run tests
97+
- name: Run Tests
98+
run: ./gradlew :plugin:check
99+
100+
# Collect Tests Result of failed tests
101+
- name: Collect Tests Result
102+
if: ${{ failure() }}
103+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
104+
with:
105+
name: tests-result
106+
path: ${{ github.workspace }}/plugin/build/reports/tests
107+
108+
# Run plugin structure verification along with IntelliJ Plugin Verifier
109+
verify:
110+
name: Verify plugin
111+
needs: [ build ]
112+
runs-on: ubuntu-latest
113+
steps:
114+
115+
# Free GitHub Actions Environment Disk Space
116+
- name: Maximize Build Space
117+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be #v1.3.1
118+
with:
119+
tool-cache: false
120+
android: false
121+
dotnet: true
122+
haskell: true
123+
large-packages: true
124+
docker-images: true
125+
swap-storage: true
126+
127+
# Check out the current repository
128+
- name: Fetch Sources
129+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
130+
131+
# Set up Java environment for the next steps
132+
- name: Setup Java
133+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
134+
with:
135+
distribution: temurin
136+
java-version: 23
137+
138+
# Setup Gradle
139+
- name: Setup Gradle
140+
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 #v4.4.1
141+
142+
# Cache Plugin Verifier IDEs
143+
- name: Setup Plugin Verifier IDEs Cache
144+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
145+
with:
146+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
147+
key: plugin-verifier-${{ hashFiles('plugin/build/listProductsReleases.txt') }}
148+
149+
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
150+
- name: Run Plugin Verification tasks
151+
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
152+
153+
# Collect Plugin Verifier Result
154+
- name: Collect Plugin Verifier Result
155+
if: ${{ always() }}
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: pluginVerifier-result
159+
path: ${{ github.workspace }}/plugin/build/reports/pluginVerifier
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish snapshot
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0'
6+
workflow_dispatch:
7+
env:
8+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
9+
10+
jobs:
11+
publish-snapshot:
12+
name: Publish snapshot
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
16+
17+
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
18+
with:
19+
distribution: temurin
20+
java-version: 23
21+
22+
- name: Publish snapshot
23+
run: ./gradlew --no-build-cache :plugin:publishPlugin
24+
env:
25+
IJ_PLUGIN_SNAPSHOT: true
26+
PUBLISH_TOKEN: ${{ secrets.IJ_PLUGIN_PUBLISH_TOKEN }}
27+
CERTIFICATE_CHAIN: ${{ secrets.IJ_PLUGIN_CERTIFICATE_CHAIN }}
28+
PRIVATE_KEY: ${{ secrets.IJ_PLUGIN_PRIVATE_KEY }}
29+
PRIVATE_KEY_PASSWORD: ${{ secrets.IJ_PLUGIN_PRIVATE_KEY_PASSWORD }}

.github/workflows/tag.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: tag
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
env:
8+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
9+
10+
jobs:
11+
publish-libraries:
12+
name: Publish libraries
13+
runs-on: macos-14
14+
if: github.repository == 'apollographql/apollo-kotlin'
15+
steps:
16+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
17+
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
18+
with:
19+
distribution: 'temurin'
20+
java-version: 17
21+
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
22+
with:
23+
gradle-home-cache-cleanup: true
24+
#--no-configuration-cache for https://youtrack.jetbrains.com/issue/KT-65879
25+
- name: Publish to Maven Central
26+
run: |
27+
./gradlew --no-build-cache ciPublishRelease -Pgradle.publish.key="${{ secrets.GRADLE_PUBLISH_KEY }}" -Pgradle.publish.secret="${{ secrets.GRADLE_PUBLISH_SECRET }}" --no-configuration-cache
28+
env:
29+
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
30+
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
31+
COM_APOLLOGRAPHQL_PROFILE_ID: ${{ secrets.COM_APOLLOGRAPHQL_PROFILE_ID }}
32+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
33+
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}
34+
35+
publish-intellij-plugin:
36+
name: Publish IntelliJ plugin
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
40+
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
41+
with:
42+
distribution: 'temurin'
43+
java-version: 17
44+
- name: Publish to JetBrains marketplace
45+
run: ./gradlew --no-build-cache :intellij-plugin:publishPlugin
46+
env:
47+
PUBLISH_TOKEN: ${{ secrets.IJ_PLUGIN_PUBLISH_TOKEN }}
48+
CERTIFICATE_CHAIN: ${{ secrets.IJ_PLUGIN_CERTIFICATE_CHAIN }}
49+
PRIVATE_KEY: ${{ secrets.IJ_PLUGIN_PRIVATE_KEY }}
50+
PRIVATE_KEY_PASSWORD: ${{ secrets.IJ_PLUGIN_PRIVATE_KEY_PASSWORD }}

plugin/src/main/kotlin/com/apollographql/ijplugin/normalizedcache/PullFromDeviceDialog.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class PullFromDeviceDialog(
7070
private fun createTree(): SimpleTree {
7171
tree = object : SimpleTree() {
7272
override fun configureUiHelper(helper: TreeUIHelper?) {
73+
@Suppress("DEPRECATION")
7374
TreeSpeedSearch(this).apply {
7475
setCanExpand(true)
7576
}

0 commit comments

Comments
 (0)