Merge pull request #208 from zowe/bugfix/IJMP-1841-201 #226
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
name: Build + Test&Sonar + Verify | |
on: [push, workflow_dispatch] | |
permissions: | |
contents: read | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
product: ["IC-231","IC-233","IC-243"] | |
include: | |
- product: "IC-231" | |
distribution: "zulu" | |
java: "17" | |
- product: "IC-233" | |
distribution: "zulu" | |
java: "17" | |
- product: "IC-243" | |
distribution: "zulu" | |
java: "21" | |
max-parallel: 10 | |
fail-fast: false | |
outputs: | |
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} | |
steps: | |
- name: Checkout the plugin GitHub repository | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: ${{ matrix.distribution }} | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Check repository content | |
shell: bash | |
run: pwd && ls -la | |
- name: Fetch Gradle properties | |
id: properties | |
env: | |
AUTO_SNAPSHOT_VERSION: false | |
PRODUCT_NAME: ${{ matrix.product }} | |
shell: bash | |
run: | | |
PROPERTIES="$(./gradlew properties --console=plain -q)" | |
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT | |
# prepare list of IDEs to use by plugin verifier: | |
./gradlew --quiet printProductsReleases > build/productReleases.txt | |
- name: Build plugin | |
shell: bash | |
run: ./gradlew buildPlugin | |
env: | |
PRODUCT_NAME: ${{ matrix.product }} | |
- 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 | |
echo "zip artifact name:" | |
echo "$FILENAME" | |
- name: Publish built plugin to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.artifact.outputs.filename }} | |
path: ./build/distributions/content/*/* | |
test_and_sonar: | |
needs: [build] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
product: ["IC-231","IC-233","IC-243"] | |
include: | |
- product: "IC-231" | |
distribution: "zulu" | |
java: "17" | |
- product: "IC-233" | |
distribution: "zulu" | |
java: "17" | |
- product: "IC-243" | |
distribution: "zulu" | |
java: "21" | |
max-parallel: 10 | |
fail-fast: false | |
steps: | |
- name: Checkout the plugin GitHub repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: ${{ matrix.distribution }} | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Run tests | |
shell: bash | |
run: ./gradlew test | |
env: | |
PRODUCT_NAME: ${{ matrix.product }} | |
- name: Publish tests result to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests-report-${{ matrix.product }} | |
path: ${{ github.workspace }}/build/reports/tests | |
- name: Publish code coverage report to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report-${{ matrix.product }} | |
path: ${{ github.workspace }}/build/reports/kover/html | |
- name: SonarCloud scans | |
if: ${{ matrix.product == 'IC-243' }} | |
continue-on-error: true | |
uses: ./.github/actions/sonar | |
env: | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
PRODUCT_NAME: ${{ matrix.product }} | |
verify: | |
if: ${{ contains(github.ref, 'refs/heads/release/') || contains(github.ref, 'refs/heads/main') }} | |
needs: [build] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
product: ["IC-231","IC-233","IC-243"] | |
include: | |
- product: "IC-231" | |
distribution: "zulu" | |
java: "17" | |
- product: "IC-233" | |
distribution: "zulu" | |
java: "17" | |
- product: "IC-243" | |
distribution: "zulu" | |
java: "21" | |
max-parallel: 10 | |
fail-fast: false | |
steps: | |
- name: Maximize Build Space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
large-packages: false | |
- name: Checkout the plugin GitHub repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: ${{ matrix.distribution }} | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Setup Plugin Verifier IDEs Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides | |
key: plugin-verifier-${{ hashFiles('build/productReleases.txt') }} | |
- name: Verify plugin against IntelliJ IDEA IDE's | |
continue-on-error: true | |
shell: bash | |
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} | |
env: | |
PRODUCT_NAME: ${{ matrix.product }} | |
- name: Collect Plugin Verifier Result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: plugin-verifier-report-${{ matrix.product }} | |
path: ${{ github.workspace }}/build/reports/pluginVerifier |