Fix #86: Allow configuration of workspace #196
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: | |
| pull_request: | |
| workflow_call: | |
| outputs: | |
| metadata-artifact-id: | |
| description: The id of the artifact containing the result of the metadata task | |
| value: ${{ jobs.build.outputs.metadata-artifact-id }} | |
| build-artifact-id: | |
| description: The id of the artifact containing the build result | |
| value: ${{ jobs.build.outputs.build-result-artifact-id }} | |
| workflow_dispatch: | |
| jobs: | |
| gradle-wrapper-validation: | |
| name: Validate Gradle Wrapper | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Validate Gradle Wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| build: | |
| name: Build Plugin | |
| runs-on: ubuntu-latest | |
| needs: gradle-wrapper-validation | |
| outputs: | |
| build-result-artifact-id: ${{ steps.upload-build-result.outputs.artifact-id }} | |
| metadata-artifact-id: ${{ steps.upload-metadata.outputs.artifact-id }} | |
| products-releases: ${{ steps.get-products-releases.outputs.products-releases }} | |
| steps: | |
| # Setup environment | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up build tools | |
| uses: ./.github/actions/setup-tools | |
| with: | |
| publish-caches: true | |
| # Collect metadata | |
| - name: Collect metadata for upcoming steps and jobs | |
| run: ./gradlew --stacktrace metadata | |
| - name: Read productsReleases.txt for compatibility testing matrix | |
| id: get-products-releases | |
| run: echo "products-releases=$(jq -Rnc '[inputs]' < gradle/productsReleases.txt)" >> "$GITHUB_OUTPUT" | |
| # Build | |
| - name: Build project | |
| run: ./gradlew --stacktrace assemble buildPlugin | |
| - name: Verify plugin | |
| run: ./gradlew --stacktrace verifyPluginStructure | |
| - name: Run linters and tests | |
| run: ./gradlew --stacktrace check | |
| # Upload artifacts | |
| - name: Upload build reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-reports | |
| path: build/reports/ | |
| if-no-files-found: ignore | |
| - name: Upload build result | |
| id: upload-build-result | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-result | |
| path: build/distributions/ | |
| if-no-files-found: error | |
| - name: Upload metadata | |
| id: upload-metadata | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: metadata | |
| path: build/metadata/ | |
| if-no-files-found: error | |
| check-compatibility: | |
| uses: ./.github/workflows/check-compatibility.yml | |
| needs: build | |
| with: | |
| products_releases: ${{ needs.build.outputs.products-releases }} |