Skip to content

chore(ci): fix disk space issue with matrix strategy and cleanup #206

chore(ci): fix disk space issue with matrix strategy and cleanup

chore(ci): fix disk space issue with matrix strategy and cleanup #206

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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Java
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.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'
- 'ideaIC:2025.3'
- 'ideaIU:2025.3'
steps:
- name: Check out repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Java
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
- name: Download built plugin artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.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 "$AGENT_TOOLSDIRECTORY"
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}}