Skip to content

Commit

Permalink
Add plugin verification workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaRanasinghe committed May 29, 2024
1 parent d8c7c40 commit 3666d90
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/plugin-verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Plugin Verification
description: |
This workflow is used to verify the plugin against different versions of IntelliJ IDEA.
It reads the minimum and maximum supported versions from the `gradle.properties` file
and runs the plugin against each version in the range.
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
workflow_dispatch:

jobs:
read-versions:
runs-on: ubuntu-latest
outputs:
min-idea-version: ${{ steps.set-env.outputs.min-idea-version }}
max-idea-version: ${{ steps.set-env.outputs.max-idea-version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Read IntelliJ IDEA versions
id: set-env
run: |
sinceBuild=$(grep "^sinceBuild" gradle.properties | cut -d'=' -f2)
untilBuild=$(grep "^untilBuild" gradle.properties | cut -d'=' -f2)
echo "min-idea-version=${sinceBuild}" >> $GITHUB_ENV
echo "max-idea-version=${untilBuild}" >> $GITHUB_ENV
echo "::set-output name=min-idea-version::${sinceBuild}"
echo "::set-output name=max-idea-version::${untilBuild}"
verify-plugin:
needs: read-versions
runs-on: ubuntu-latest
strategy:
matrix:
idea-version: [ ${ { needs.read-versions.outputs.min-idea-version } }, ${ { needs.read-versions.outputs.max-idea-version } } ]

concurrency:
group: ${{ github.head_ref }}-ubuntu-verify
cancel-in-progress: true

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'

- name: Verify against IDEA ${{ matrix.idea-version }}
run: ./gradlew runIde -PideaVersion=${{ matrix.idea-version }}
30 changes: 30 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pull Request

on:
pull_request:
branches:
- master
- 2.[0-9]+.x

jobs:
pr-check:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event.pull_request.head.ref }}-pr-check
cancel-in-progress: true

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'

- name: Run Build
run: ./gradlew build -x test

- name: Run Tests
run: ./gradlew build test

0 comments on commit 3666d90

Please sign in to comment.