Skip to content

Commit aa3aa50

Browse files
meanmailclaude
andauthored
CI: run tests and verification before building artifacts (#30)
* CI: run tests and verification before building artifacts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * CI: split into separate CI and Publish workflows - ci.yaml: tests + verification on PRs and push to main - publish.yaml: build + publish on push to main and GitHub release Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * CI: make Publish workflow depend on successful CI Use workflow_run trigger so publishing only runs after CI passes. Release events still trigger directly (CI doesn't run on releases). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e5a694f commit aa3aa50

2 files changed

Lines changed: 59 additions & 13 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
concurrency:
9+
group: ci-${{ github.ref_name }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check:
14+
name: Check the plugin for ${{ matrix.environmentName }}
15+
runs-on: arc-runners-large
16+
timeout-minutes: 60
17+
strategy:
18+
matrix:
19+
environmentName:
20+
- 252
21+
- 253
22+
- 261
23+
fail-fast: false
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 1
29+
30+
- name: Setup Corretto JDK
31+
uses: actions/setup-java@v4
32+
with:
33+
java-version-file: '.java-version'
34+
distribution: 'corretto'
35+
36+
- name: Setup Gradle
37+
uses: gradle/actions/setup-gradle@v3
38+
39+
- name: Resolve plugin version
40+
run: |
41+
BASE_VERSION=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2)
42+
echo "VERSION=${BASE_VERSION}.${{ github.run_number }}" >> $GITHUB_ENV
43+
44+
- name: Run tests
45+
run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
46+
47+
- name: Verify plugin
48+
run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}

.github/workflows/publish.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
name: Plugin deployment
1+
name: Publish
22

33
on:
4-
push:
4+
workflow_run:
5+
workflows: [ CI ]
6+
types: [ completed ]
57
branches: [ main ]
6-
pull_request:
78
release:
89
types: [ published ]
910

1011
concurrency:
11-
group: publish-plugin-${{ github.ref_name }}
12+
group: publish-${{ github.ref_name }}
1213
cancel-in-progress: true
1314

1415
jobs:
15-
deploy:
16-
name: Deploy the plugin for ${{ matrix.environmentName }}
16+
publish:
17+
name: Publish the plugin for ${{ matrix.environmentName }}
1718
runs-on: arc-runners-large
1819
timeout-minutes: 60
20+
if: >
21+
(github.event_name == 'release') ||
22+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
1923
strategy:
2024
matrix:
2125
environmentName:
@@ -53,14 +57,8 @@ jobs:
5357
path: intellij-plugin/build/distributions
5458
retention-days: 3
5559

56-
- name: Run tests
57-
run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
58-
59-
- name: Verify plugin
60-
run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
61-
6260
- name: Publish plugin to Marketplace (dev channel)
63-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
61+
if: github.event_name == 'workflow_run'
6462
run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
6563
env:
6664
JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}

0 commit comments

Comments
 (0)