Skip to content

Merge pull request #127 from openfga/dependabot/github_actions/depend… #212

Merge pull request #127 from openfga/dependabot/github_actions/depend…

Merge pull request #127 from openfga/dependabot/github_actions/depend… #212

Workflow file for this run

name: Pull Request build and test
permissions:
contents: read
on:
workflow_call:
workflow_dispatch:
merge_group:
pull_request:
push:
branches:
- main
env:
PLUGIN_ARTIFACT_NAME: 'openfga_intellij_plugin'
DIST_FOLDER: 'build/distributions'
JAVA_VERSION: '17'
jobs:
build:
name: Build OpenFGA plugin for IntelliJ Platform
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Java
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
- name: Build the plugin using Gradle
run: ./gradlew check buildPlugin
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: '${{ env.PLUGIN_ARTIFACT_NAME }}'
path: '${{ env.DIST_FOLDER }}/'
test_compatibility:
name: Test plugin compatibility with IntelliJ Platform ${{ matrix.ide-version }}
needs:
- build
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 2 # Limit parallelization to avoid overwhelming runners
matrix:
ide-version:
- 'ideaIC:2023.3'
- 'ideaIC:2024.3'
- 'ideaIU:2023.3'
- 'ideaIU:2024.3'
- 'ideaIU:2025.3.1'
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Java
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
- name: Download built plugin artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ${{ env.PLUGIN_ARTIFACT_NAME }}
path: ${{ env.DIST_FOLDER }}
- name: Free up disk space
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android
sudo rm -rf "$RUNNER_TOOL_CACHE"
echo "Disk space after cleanup:"
df -h
- name: Verify Plugin on IntelliJ Platform ${{ matrix.ide-version }}
id: verify
uses: ChrisCarini/intellij-platform-plugin-verifier-action@d04116ac843966179c3d74ed298cfce2ddfbb0ad # v2.0.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
ide-versions: ${{ matrix.ide-version }}
plugin-location: '${{ env.DIST_FOLDER }}/*.zip'
- name: Get log file path and print contents
run: |
echo "The verifier log file [${{steps.verify.outputs.verification-output-log-filename}}] contents : " ;
cat ${{steps.verify.outputs.verification-output-log-filename}}