Skip to content

Commit d5040bd

Browse files
committed
Initial commit
0 parents  commit d5040bd

File tree

217 files changed

+11957
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+11957
-0
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[*.{kt,kts}]

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot configuration:
2+
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# Maintain dependencies for Gradle dependencies
7+
- package-ecosystem: "gradle"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"
11+
# Maintain dependencies for GitHub Actions
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"

.github/release-drafter.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name-template: 'v$RESOLVED_VERSION 🌈'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: 'New Features'
5+
labels:
6+
- 'feature'
7+
- 'enhancement'
8+
- title: 'Bug Fixes'
9+
labels:
10+
- 'fix'
11+
- 'bugfix'
12+
- 'bug'
13+
- title: 'Maintenance'
14+
labels:
15+
- 'chore'
16+
- 'ci'
17+
- 'perf'
18+
- 'refactor'
19+
- 'security'
20+
- 'test'
21+
- title: 'Documentation'
22+
labels:
23+
- 'docs'
24+
- title: 'Dependency Updates'
25+
labels:
26+
- 'dependencies'
27+
28+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
29+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
30+
exclude-labels:
31+
- 'skip-changelog'
32+
33+
version-resolver:
34+
major:
35+
labels:
36+
- 'major'
37+
minor:
38+
labels:
39+
- 'minor'
40+
- 'feat'
41+
- 'feature'
42+
patch:
43+
labels:
44+
- 'patch'
45+
default: patch
46+
47+
autolabeler:
48+
- label: 'chore'
49+
branch:
50+
- '/chore\/.+/'
51+
- label: 'ci'
52+
branch:
53+
- '/ci\/.+/'
54+
- label: 'dependencies'
55+
branch:
56+
- '/dependencies\/.+/'
57+
- label: 'docs'
58+
branch:
59+
- '/docs\/.+/'
60+
- label: 'feature'
61+
branch:
62+
- '/feat(ure)?\/.+/'
63+
- label: 'fix'
64+
branch:
65+
- '/fix\/.+/'
66+
- label: 'perf'
67+
branch:
68+
- '/perf\/.+/'
69+
- label: 'refactor'
70+
branch:
71+
- '/refactor\/.+/'
72+
- label: 'security'
73+
branch:
74+
- '/security\/.+/'
75+
- label: 'test'
76+
branch:
77+
- '/test\/.+/'
78+
79+
template: |
80+
# What's Changed
81+
82+
$CHANGES
83+
84+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION

.github/workflows/build.yml

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
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.
8+
#
9+
# The workflow is triggered on push and pull_request events.
10+
#
11+
# GitHub Actions reference: https://help.github.com/en/actions
12+
#
13+
## JBIJPPTPL
14+
15+
name: Build
16+
on:
17+
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
18+
push:
19+
branches: [ main ]
20+
# Trigger the workflow on any pull request
21+
pull_request:
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
29+
# Prepare environment and build the plugin
30+
build:
31+
name: Build
32+
runs-on: ubuntu-22.04
33+
outputs:
34+
version: ${{ steps.properties.outputs.version }}
35+
changelog: ${{ steps.properties.outputs.changelog }}
36+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
37+
steps:
38+
39+
# Check out the current repository
40+
- name: Fetch Sources
41+
uses: actions/checkout@v4
42+
43+
# Validate wrapper
44+
- name: Gradle Wrapper Validation
45+
uses: gradle/actions/wrapper-validation@v4
46+
47+
# Set up Java environment for the next steps
48+
- name: Setup Java
49+
uses: actions/setup-java@v4
50+
with:
51+
distribution: zulu
52+
java-version: 17
53+
54+
# Setup Gradle
55+
- name: Setup Gradle
56+
uses: gradle/actions/setup-gradle@v4
57+
58+
# Set environment variables
59+
- name: Export Properties
60+
id: properties
61+
shell: bash
62+
run: |
63+
PROPERTIES="$(./gradlew properties --console=plain -q)"
64+
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
65+
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
66+
67+
echo "version=$VERSION" >> $GITHUB_OUTPUT
68+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
69+
70+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
71+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
72+
echo "EOF" >> $GITHUB_OUTPUT
73+
74+
# Generate Lexer and Parser
75+
- name: Generate Lexer
76+
run: ./gradlew generateLexer
77+
78+
- name: Generate Parser
79+
run: ./gradlew generateParser
80+
81+
# Build plugin
82+
- name: Build plugin
83+
run: ./gradlew buildPlugin -PpluginVersion=0.3.0
84+
85+
# Prepare plugin archive content for creating artifact
86+
- name: Prepare Plugin Artifact
87+
id: artifact
88+
shell: bash
89+
run: |
90+
cd ${{ github.workspace }}/build/distributions
91+
FILENAME=`ls *.zip`
92+
unzip "$FILENAME" -d content
93+
94+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
95+
96+
# Store already-built plugin as an artifact for downloading
97+
- name: Upload artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: ${{ steps.artifact.outputs.filename }}
101+
path: ./build/distributions/content/*/*
102+
103+
# Run tests and upload a code coverage report
104+
test:
105+
name: Test
106+
needs: [ build ]
107+
runs-on: ubuntu-22.04
108+
steps:
109+
110+
# Check out the current repository
111+
- name: Fetch Sources
112+
uses: actions/checkout@v4
113+
114+
# Set up Java environment for the next steps
115+
- name: Setup Java
116+
uses: actions/setup-java@v4
117+
with:
118+
distribution: zulu
119+
java-version: 17
120+
121+
# Setup Gradle
122+
- name: Setup Gradle
123+
uses: gradle/actions/setup-gradle@v4
124+
125+
# Generate Lexer and Parser
126+
- name: Generate Lexer
127+
run: ./gradlew generateLexer
128+
129+
- name: Generate Parser
130+
run: ./gradlew generateParser
131+
132+
# Run tests
133+
- name: Run Tests
134+
run: ./gradlew check
135+
136+
# Collect Tests Result of failed tests
137+
- name: Collect Tests Result
138+
if: ${{ failure() }}
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: tests-result
142+
path: ${{ github.workspace }}/build/reports/tests
143+
144+
# Upload the Kover report to CodeCov
145+
- name: Upload Code Coverage Report
146+
uses: codecov/codecov-action@v5
147+
with:
148+
files: ${{ github.workspace }}/build/reports/kover/report.xml
149+
150+
# Run Qodana inspections and provide report
151+
inspectCode:
152+
name: Inspect code
153+
needs: [ build ]
154+
runs-on: ubuntu-22.04
155+
permissions:
156+
contents: write
157+
checks: write
158+
pull-requests: write
159+
steps:
160+
161+
# Free GitHub Actions Environment Disk Space
162+
- name: Maximize Build Space
163+
uses: jlumbroso/free-disk-space@main
164+
with:
165+
tool-cache: false
166+
large-packages: false
167+
168+
# Check out the current repository
169+
- name: Fetch Sources
170+
uses: actions/checkout@v4
171+
with:
172+
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
173+
fetch-depth: 0 # a full history is required for pull request analysis
174+
175+
# Set up Java environment for the next steps
176+
- name: Setup Java
177+
uses: actions/setup-java@v4
178+
with:
179+
distribution: zulu
180+
java-version: 17
181+
182+
# Generate Lexer and Parser
183+
- name: Generate Lexer
184+
run: ./gradlew generateLexer
185+
186+
- name: Generate Parser
187+
run: ./gradlew generateParser
188+
189+
# Run Qodana inspections
190+
- name: Qodana - Code Inspection
191+
uses: JetBrains/[email protected]
192+
with:
193+
cache-default-branch-only: true
194+
upload-result: true
195+
196+
# Run plugin structure verification along with IntelliJ Plugin Verifier
197+
verify:
198+
name: Verify plugin
199+
needs: [ build ]
200+
runs-on: ubuntu-22.04
201+
steps:
202+
203+
# Free GitHub Actions Environment Disk Space
204+
- name: Maximize Build Space
205+
uses: jlumbroso/free-disk-space@main
206+
with:
207+
tool-cache: false
208+
large-packages: false
209+
210+
# Check out the current repository
211+
- name: Fetch Sources
212+
uses: actions/checkout@v4
213+
214+
# Set up Java environment for the next steps
215+
- name: Setup Java
216+
uses: actions/setup-java@v4
217+
with:
218+
distribution: zulu
219+
java-version: 17
220+
221+
# Setup Gradle
222+
- name: Setup Gradle
223+
uses: gradle/actions/setup-gradle@v4
224+
225+
# Generate Lexer and Parser
226+
- name: Generate Lexer
227+
run: ./gradlew generateLexer
228+
229+
- name: Generate Parser
230+
run: ./gradlew generateParser
231+
232+
# Cache Plugin Verifier IDEs
233+
- name: Setup Plugin Verifier IDEs Cache
234+
uses: actions/cache@v4
235+
with:
236+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
237+
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
238+
239+
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
240+
- name: Run Plugin Verification tasks
241+
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
242+
243+
# Collect Plugin Verifier Result
244+
- name: Collect Plugin Verifier Result
245+
if: ${{ always() }}
246+
uses: actions/upload-artifact@v4
247+
with:
248+
name: pluginVerifier-result
249+
path: ${{ github.workspace }}/build/reports/pluginVerifier
250+
251+
# Prepare a draft release for GitHub Releases page for the manual verification
252+
# If accepted and published, release workflow would be triggered
253+
releaseDraft:
254+
name: Release draft
255+
if: github.event_name != 'pull_request'
256+
needs: [ build, test, inspectCode, verify ]
257+
runs-on: ubuntu-22.04
258+
permissions:
259+
contents: write
260+
steps:
261+
262+
# Check out the current repository
263+
- name: Fetch Sources
264+
uses: actions/checkout@v4
265+
266+
# Remove old release drafts by using the curl request for the available releases with a draft flag
267+
- name: Remove Old Release Drafts
268+
env:
269+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
270+
run: |
271+
gh api repos/{owner}/{repo}/releases \
272+
--jq '.[] | select(.draft == true) | .id' \
273+
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
274+
275+
# Create a new release draft which is not publicly visible and requires manual acceptance
276+
- name: Create Release Draft
277+
env:
278+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
279+
run: |
280+
gh release create "v${{ needs.build.outputs.version }}" \
281+
--draft \
282+
--title "v${{ needs.build.outputs.version }}" \
283+
--notes "$(cat << 'EOM'
284+
${{ needs.build.outputs.changelog }}
285+
EOM
286+
)"

0 commit comments

Comments
 (0)