[pre-commit.ci] pre-commit autoupdate #796
Workflow file for this run
This file contains hidden or 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: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build plugin | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.properties.outputs.version }} | |
| changelog: ${{ steps.properties.outputs.changelog }} | |
| pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} | |
| platformVersion: ${{ steps.properties.outputs.platformVersion }} | |
| steps: | |
| - name: Maximize Build Space | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: false | |
| large-packages: false | |
| - name: Checkout git repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 21 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Build plugin | |
| run: ./gradlew --console=plain 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 | |
| - name: Upload artifact for later download | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ steps.artifact.outputs.filename }} | |
| path: ./build/distributions/content/*/* | |
| - name: Export plugin properties | |
| id: properties | |
| shell: bash | |
| run: | | |
| PROPERTIES="$(./gradlew properties --console=plain -q)" | |
| VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "pluginVerifierHomeDir=$HOME/.pluginVerifier" >> $GITHUB_OUTPUT | |
| echo "platformVersion=$(echo "$PROPERTIES" | grep "^platformVersion:" | cut -f2- -d ' ')" >> $GITHUB_OUTPUT | |
| CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" | |
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| verify: | |
| name: Verify (${{ matrix.ide }}) | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ide: [PC, PY] | |
| steps: | |
| - name: Free disk space | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: false | |
| large-packages: false | |
| android: true | |
| dotnet: true | |
| - name: Checkout git repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 21 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| validate-wrappers: false | |
| cache-read-only: false | |
| - name: Cache plugin verifier IDEs | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.pluginVerifier/ides | |
| key: plugin-verifier-ides-${{ matrix.ide }}-${{ needs.build.outputs.platformVersion }} | |
| - name: Clean corrupted Gradle transforms | |
| run: rm -rf ~/.gradle/caches/*/transforms | |
| - name: Run verification | |
| run: ./gradlew verifyPlugin -PverifyIde=${{ matrix.ide }} | |
| - name: Collect verification result | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: pluginVerifier-result-${{ matrix.ide }} | |
| path: ${{ github.workspace }}/build/reports/pluginVerifier | |
| lint: | |
| name: Lint | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout git repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 21 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| cache-read-only: false | |
| - name: Clean corrupted Gradle transforms | |
| run: rm -rf ~/.gradle/caches/*/transforms | |
| - name: Run linter | |
| run: ./gradlew ktlintCheck | |
| test: | |
| name: Run tests | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout git repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 21 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| validate-wrappers: false | |
| cache-read-only: false | |
| - name: Clean corrupted Gradle transforms | |
| run: rm -rf ~/.gradle/caches/*/transforms | |
| - name: Run unit tests | |
| run: ./gradlew test | |
| - name: Verify 100% coverage | |
| run: ./gradlew koverVerify | |
| - name: Run UI tests | |
| run: | | |
| export DISPLAY=:99.0 | |
| Xvfb :99 -screen 0 1920x1080x24 & | |
| ./gradlew runIdeForUiTests & | |
| echo "Waiting for IDE to start..." | |
| timeout 180 bash -c 'until curl -s http://127.0.0.1:8082 > /dev/null 2>&1; do sleep 2; done' || { echo "IDE failed to start"; exit 1; } | |
| echo "IDE is ready" | |
| ./gradlew uiTest | |
| kill %1 %2 || true | |
| releaseDraft: | |
| name: Create release draft | |
| if: github.event_name != 'pull_request' | |
| needs: [build, lint, test, verify] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout git repository | |
| uses: actions/checkout@v6 | |
| - name: Remove old release drafts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api repos/{owner}/{repo}/releases --jq '.[] | select(.draft == true) | .id' \ | |
| | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} | |
| - name: Create release draft | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "v${{ needs.build.outputs.version }}" \ | |
| --draft \ | |
| --title "v${{ needs.build.outputs.version }}" \ | |
| --notes "$(cat << 'EOM' | |
| ${{ needs.build.outputs.changelog }} | |
| EOM | |
| )" |