ci: Add GitHub Actions workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
outputs: | |
pluginVerifierHomeDir: ${{ steps.plugin-verifier.outputs.pluginVerifierHomeDir }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/[email protected] | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: oracle | |
java-version: 21 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Prepare plugin verifier | |
id: plugin-verifier | |
shell: bash | |
run: | | |
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT | |
./gradlew listProductsReleases | |
- run: ./gradlew buildPlugin | |
- name: Prepare Plugin Artifact | |
id: artifact | |
shell: bash | |
run: | | |
cd ${{ github.workspace }}/build/distributions | |
FILENAME=`ls *.zip` | |
unzip "$FILENAME" -d content | |
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.artifact.outputs.filename }} | |
path: ./build/distributions/content/*/* | |
verify: | |
name: Verify plugin | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
large-packages: false | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: oracle | |
java-version: 21 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides | |
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} | |
- name: Run Plugin Verification tasks | |
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} | |
- name: Collect Plugin Verifier Result | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pluginVerifier-result | |
path: ${{ github.workspace }}/build/reports/pluginVerifier |