Skip to content

Commit

Permalink
ci: Add GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Aug 15, 2024
1 parent ed87a96 commit e040fc4
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ indent_size = 4
indent_style = space
insert_final_newline = true

[{.idea/*.xml,*.iml}]
[*.{iml,xml,yaml}]
indent_size = 2
87 changes: 87 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
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

0 comments on commit e040fc4

Please sign in to comment.