Skip to content

Commit ec9bce3

Browse files
authored
Merge pull request #3: fix CI
2 parents 42bccbc + 4a45b7e commit ec9bce3

15 files changed

+249
-233
lines changed

Diff for: .github/workflows/build.yml

+108-80
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,84 @@
1-
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
2-
# - validate Gradle Wrapper,
3-
# - run 'test' and 'verifyPlugin' tasks,
4-
# - run Qodana inspections,
5-
# - run 'buildPlugin' task and prepare artifact for the further tests,
6-
# - run 'runPluginVerifier' task,
7-
# - create a draft release.
1+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2+
# - Validate Gradle Wrapper.
3+
# - Run 'test' and 'verifyPlugin' tasks.
4+
# - Run Qodana inspections.
5+
# - Run the 'buildPlugin' task and prepare artifact for further tests.
6+
# - Run the 'runPluginVerifier' task.
7+
# - Create a draft release.
88
#
9-
# Workflow is triggered on push and pull_request events.
9+
# The workflow is triggered on push and pull_request events.
1010
#
1111
# GitHub Actions reference: https://help.github.com/en/actions
1212
#
1313
## JBIJPPTPL
1414

1515
name: Build
1616
on:
17-
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
17+
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
1818
push:
19-
branches: [main]
19+
branches: [ main, develop ]
2020
# Trigger the workflow on any pull request
2121
pull_request:
2222

23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
2327
jobs:
24-
25-
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
26-
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
27-
# Build plugin and provide the artifact for the next workflow jobs
28+
29+
# Prepare environment and build the plugin
2830
build:
2931
name: Build
3032
runs-on: ubuntu-latest
3133
outputs:
3234
version: ${{ steps.properties.outputs.version }}
3335
changelog: ${{ steps.properties.outputs.changelog }}
36+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3437
steps:
35-
38+
3639
# Check out current repository
3740
- name: Fetch Sources
38-
uses: actions/checkout@v2.4.0
39-
41+
uses: actions/checkout@v4
42+
4043
# Validate wrapper
4144
- name: Gradle Wrapper Validation
42-
uses: gradle/wrapper-validation-action@v1.0.4
43-
44-
# Setup Java 11 environment for the next steps
45+
uses: gradle/wrapper-validation-action@v2
46+
47+
# Set up Java environment for the next steps
4548
- name: Setup Java
46-
uses: actions/setup-java@v2
49+
uses: actions/setup-java@v4
4750
with:
4851
distribution: zulu
49-
java-version: 11
50-
cache: gradle
51-
52+
java-version: 17
53+
54+
# Setup Gradle
55+
- name: Setup Gradle
56+
uses: gradle/actions/setup-gradle@v3
57+
with:
58+
gradle-home-cache-cleanup: true
59+
5260
# Set environment variables
5361
- name: Export Properties
5462
id: properties
5563
shell: bash
5664
run: |
5765
PROPERTIES="$(./gradlew properties --console=plain -q)"
5866
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
59-
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
6067
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
61-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
62-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
63-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
6468
65-
echo "::set-output name=version::$VERSION"
66-
echo "::set-output name=name::$NAME"
67-
echo "::set-output name=changelog::$CHANGELOG"
68-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
69+
echo "version=$VERSION" >> $GITHUB_OUTPUT
70+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
71+
72+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
73+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
74+
echo "EOF" >> $GITHUB_OUTPUT
6975
7076
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
71-
72-
# Run tests
73-
- name: Run Tests
74-
run: ./gradlew test
75-
76-
# Collect Tests Result of failed tests
77-
- name: Collect Tests Result
78-
if: ${{ failure() }}
79-
uses: actions/upload-artifact@v2
80-
with:
81-
name: tests-result
82-
path: ${{ github.workspace }}/build/reports/tests
83-
84-
# # Cache Plugin Verifier IDEs
85-
# - name: Setup Plugin Verifier IDEs Cache
86-
# uses: actions/[email protected]
87-
# with:
88-
# path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
89-
# key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
90-
#
91-
# # Run Verify Plugin task and IntelliJ Plugin Verifier tool
92-
# - name: Run Plugin Verification tasks
93-
# run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
94-
#
95-
# # Collect Plugin Verifier Result
96-
# - name: Collect Plugin Verifier Result
97-
# if: ${{ always() }}
98-
# uses: actions/upload-artifact@v2
99-
# with:
100-
# name: pluginVerifier-result
101-
# path: ${{ github.workspace }}/build/reports/pluginVerifier
102-
103-
# TODO: temp needed because verifier disabled
104-
- run: ./gradlew buildPlugin
105-
77+
78+
# Build plugin
79+
- name: Build plugin
80+
run: ./gradlew buildPlugin
81+
10682
# Prepare plugin archive content for creating artifact
10783
- name: Prepare Plugin Artifact
10884
id: artifact
@@ -112,43 +88,95 @@ jobs:
11288
FILENAME=`ls *.zip`
11389
unzip "$FILENAME" -d content
11490
115-
echo "::set-output name=filename::${FILENAME:0:-4}"
116-
91+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
92+
11793
# Store already-built plugin as an artifact for downloading
11894
- name: Upload artifact
119-
uses: actions/upload-artifact@v2.2.4
95+
uses: actions/upload-artifact@v4
12096
with:
12197
name: ${{ steps.artifact.outputs.filename }}
12298
path: ./build/distributions/content/*/*
123-
99+
100+
# Run plugin structure verification along with IntelliJ Plugin Verifier
101+
verify:
102+
name: Verify plugin
103+
needs: [ build ]
104+
runs-on: ubuntu-latest
105+
steps:
106+
107+
# Free GitHub Actions Environment Disk Space
108+
- name: Maximize Build Space
109+
uses: jlumbroso/free-disk-space@main
110+
with:
111+
tool-cache: false
112+
large-packages: false
113+
114+
# Check out current repository
115+
- name: Fetch Sources
116+
uses: actions/checkout@v4
117+
118+
# Set up Java environment for the next steps
119+
- name: Setup Java
120+
uses: actions/setup-java@v4
121+
with:
122+
distribution: zulu
123+
java-version: 17
124+
125+
# Setup Gradle
126+
- name: Setup Gradle
127+
uses: gradle/actions/setup-gradle@v3
128+
with:
129+
gradle-home-cache-cleanup: true
130+
131+
# Cache Plugin Verifier IDEs
132+
- name: Setup Plugin Verifier IDEs Cache
133+
uses: actions/cache@v4
134+
with:
135+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
136+
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
137+
138+
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
139+
- name: Run Plugin Verification tasks
140+
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
141+
142+
# Collect Plugin Verifier Result
143+
- name: Collect Plugin Verifier Result
144+
if: ${{ always() }}
145+
uses: actions/upload-artifact@v4
146+
with:
147+
name: pluginVerifier-result
148+
path: ${{ github.workspace }}/build/reports/pluginVerifier
149+
124150
# Prepare a draft release for GitHub Releases page for the manual verification
125151
# If accepted and published, release workflow would be triggered
126152
releaseDraft:
127-
name: Release Draft
153+
name: Release draft
128154
if: github.event_name != 'pull_request'
129-
needs: build
155+
needs: [ build, test, inspectCode, verify ]
130156
runs-on: ubuntu-latest
157+
permissions:
158+
contents: write
131159
steps:
132-
160+
133161
# Check out current repository
134162
- name: Fetch Sources
135-
uses: actions/checkout@v2.4.0
136-
137-
# Remove old release drafts by using the curl request for the available releases with draft flag
163+
uses: actions/checkout@v4
164+
165+
# Remove old release drafts by using the curl request for the available releases with a draft flag
138166
- name: Remove Old Release Drafts
139167
env:
140168
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141169
run: |
142170
gh api repos/{owner}/{repo}/releases \
143171
--jq '.[] | select(.draft == true) | .id' \
144172
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
145-
146-
# Create new release draft - which is not publicly visible and requires manual acceptance
173+
174+
# Create a new release draft which is not publicly visible and requires manual acceptance
147175
- name: Create Release Draft
148176
env:
149177
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150178
run: |
151-
gh release create v${{ needs.build.outputs.version }} \
179+
gh release create "v${{ needs.build.outputs.version }}" \
152180
--draft \
153181
--title "v${{ needs.build.outputs.version }}" \
154182
--notes "$(cat << 'EOM'

Diff for: .run/Run IDE with Plugin.run.xml renamed to .run/Run Plugin.run.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<option name="executionName" />
66
<option name="externalProjectPath" value="$PROJECT_DIR$" />
77
<option name="externalSystemIdString" value="GRADLE" />
8-
<option name="scriptParameters" value="--stacktrace" />
8+
<option name="scriptParameters" value="" />
99
<option name="taskDescriptions">
1010
<list />
1111
</option>
@@ -19,7 +19,6 @@
1919
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
2020
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
2121
<DebugAllEnabled>false</DebugAllEnabled>
22-
<RunAsTest>false</RunAsTest>
2322
<method v="2" />
2423
</configuration>
2524
</component>

Diff for: .run/Run Qodana.run.xml

-26
This file was deleted.

Diff for: .run/Run Plugin Tests.run.xml renamed to .run/Run Tests.run.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
</option>
1212
<option name="taskNames">
1313
<list>
14-
<option value="test" />
14+
<option value="check" />
1515
</list>
1616
</option>
1717
<option name="vmOptions" value="" />
1818
</ExternalSystemSettings>
1919
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
2020
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
2121
<DebugAllEnabled>false</DebugAllEnabled>
22+
<RunAsTest>true</RunAsTest>
2223
<method v="2" />
2324
</configuration>
24-
</component>
25+
</component>
File renamed without changes.

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
22

3+
# Buggregator Changelog
4+
5+
## Unreleased
6+
37
## 0.0.1
48

59
### Added

0 commit comments

Comments
 (0)