From f4e8f36330ca6354f12d8d9934712cf4ac60edc4 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Wed, 17 Jul 2024 18:28:21 +0200 Subject: [PATCH] IJMP-1817 Testing new GitHub Actions Signed-off-by: Uladzislau --- .github/workflows/build.yml | 62 +++++++++++++++++++---- .github/workflows/release.yml | 94 ++++++++++++++++++++++++++--------- .gitlab-ci.yml | 52 ------------------- zowe-galasa-intellij | 1 + 4 files changed, 125 insertions(+), 84 deletions(-) delete mode 100644 .gitlab-ci.yml create mode 160000 zowe-galasa-intellij diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 545b57b3..3af111d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,18 @@ concurrency: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + product: ["IC-231","IC-233"] + include: + - product: "IC-231" + distribution: "zulu" + java: "17" + - product: "IC-233" + distribution: "zulu" + java: "17" + max-parallel: 10 + fail-fast: false outputs: pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} steps: @@ -32,8 +44,8 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - distribution: zulu - java-version: 17 + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 @@ -48,6 +60,7 @@ jobs: id: properties env: AUTO_SNAPSHOT_VERSION: false + PRODUCT_NAME: ${{ matrix.product }} shell: bash run: | PROPERTIES="$(./gradlew properties --console=plain -q)" @@ -60,6 +73,8 @@ jobs: - name: Build plugin shell: bash run: ./gradlew buildPlugin + env: + PRODUCT_NAME: ${{ matrix.product }} - name: Prepare Plugin Artifact id: artifact @@ -81,6 +96,18 @@ jobs: test_and_sonar: needs: [build] runs-on: ubuntu-latest + strategy: + matrix: + product: ["IC-231","IC-233"] + include: + - product: "IC-231" + distribution: "zulu" + java: "17" + - product: "IC-233" + distribution: "zulu" + java: "17" + max-parallel: 10 + fail-fast: false steps: - name: Checkout the plugin GitHub repository @@ -89,8 +116,8 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - distribution: zulu - java-version: 17 + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 @@ -100,6 +127,8 @@ jobs: - name: Run tests shell: bash run: ./gradlew test + env: + PRODUCT_NAME: ${{ matrix.product }} - name: Publish tests result to artifacts uses: actions/upload-artifact@v4 @@ -110,7 +139,7 @@ jobs: - name: Publish code coverage report to artifacts uses: actions/upload-artifact@v4 with: - name: code-coverage-report + name: code-coverage-report-${{ matrix.product }} path: ${{ github.workspace }}/build/reports/kover/html - name: SonarCloud scans @@ -120,11 +149,24 @@ jobs: 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/') }} + 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"] + include: + - product: "IC-231" + distribution: "zulu" + java: "17" + - product: "IC-233" + distribution: "zulu" + java: "17" + max-parallel: 10 + fail-fast: false steps: - name: Maximize Build Space @@ -139,8 +181,8 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - distribution: zulu - java-version: 17 + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 @@ -157,9 +199,11 @@ jobs: continue-on-error: true shell: bash run: ./gradlew runPluginVerifier -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 + name: plugin-verifier-report-${{ matrix.product }} path: ${{ github.workspace }}/build/reports/pluginVerifier diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 956b17a2..8264e803 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ on: workflow_dispatch: jobs: - release: + changelog-and-preparations: runs-on: ubuntu-latest permissions: contents: write @@ -28,7 +28,7 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - distribution: zulu + distribution: "zulu" java-version: 17 - name: Setup Gradle @@ -44,20 +44,12 @@ jobs: PLUGIN_VERSION_FULL="$(echo "$PROPERTIES" | grep "^pluginVersion:" | cut -f2- -d ' ')" CURR_COMMIT="$(git rev-parse HEAD)" - echo "pluginVersionFull: $PLUGIN_VERSION_FULL" + echo "pluginVersionSemVer: $PLUGIN_VERSION_FULL" echo "currCommit: $CURR_COMMIT" - echo "pluginVersionFull=$PLUGIN_VERSION_FULL" >> $GITHUB_OUTPUT + echo "pluginVersionSemVer=$PLUGIN_VERSION_FULL" >> $GITHUB_OUTPUT echo "currCommit=$CURR_COMMIT" >> $GITHUB_OUTPUT - - name: Publish Plugin - env: - INTELLIJ_SIGNING_PUBLISH_TOKEN: ${{ secrets.INTELLIJ_SIGNING_PUBLISH_TOKEN }} - INTELLIJ_SIGNING_CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_SIGNING_CERTIFICATE_CHAIN }} - INTELLIJ_SIGNING_PRIVATE_KEY: ${{ secrets.INTELLIJ_SIGNING_PRIVATE_KEY }} - INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD }} - run: ./gradlew publishPlugin - - name: Prepare release notes id: release_notes shell: bash @@ -75,23 +67,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git tag ${{ steps.properties.outputs.pluginVersionFull }} - git push origin ${{ steps.properties.outputs.pluginVersionFull }} - gh release create ${{ steps.properties.outputs.pluginVersionFull }} --title ${{ steps.properties.outputs.pluginVersionFull }} --target ${{ steps.properties.outputs.currCommit }} -F- <> $GITHUB_OUTPUT + echo "currCommit=$CURR_COMMIT" >> $GITHUB_OUTPUT + + - name: Publish Plugin + env: + INTELLIJ_SIGNING_PUBLISH_TOKEN: ${{ secrets.INTELLIJ_SIGNING_PUBLISH_TOKEN }} + INTELLIJ_SIGNING_CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_SIGNING_CERTIFICATE_CHAIN }} + INTELLIJ_SIGNING_PRIVATE_KEY: ${{ secrets.INTELLIJ_SIGNING_PRIVATE_KEY }} + INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD }} + PRODUCT_NAME: ${{ matrix.product }} + run: ./gradlew publishPlugin + + - name: Upload Release Built Artifact + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ steps.properties.outputs.pluginVersionFull }} ./build/distributions/* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index fdc5a653..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,52 +0,0 @@ -build-job: - stage: build - image: openjdk:17 - parallel: - matrix: - - PRODUCT_NAME: "IC-231" - - PRODUCT_NAME: "IC-233" - script: - - | - echo "Build is going to proceed with the next Java:" - java -version - echo "Gradle Wrapper:" - ./gradlew -v - echo "Current directory state:" - ls -la - ./gradlew buildPlugin - cd build/distributions - ZIP_NAME_WITH_EXT=`ls *.zip` - unzip "$ZIP_NAME_WITH_EXT" -d content - mv content/* ../../built-plugin - artifacts: - name: "for-mainframe-private" - paths: - - built-plugin/ - expire_in: 4 weeks - -test-job: - stage: test - image: openjdk:17 - parallel: - matrix: - - PRODUCT_NAME: "IC-231" - - PRODUCT_NAME: "IC-233" - script: - - | - echo "Test is going to proceed with the next Java:" - java -version - echo "Gradle Wrapper:" - ./gradlew -v - echo "Current directory state:" - ls -la - - ./gradlew test - - mv build/reports/tests junit-report - - mv build/reports/kover/html kover-report - artifacts: - name: "for-mainframe-test-results" - paths: - - junit-report/ - - kover-report/ - reports: - junit: build/test-results/test/*.xml - expire_in: 4 weeks diff --git a/zowe-galasa-intellij b/zowe-galasa-intellij new file mode 160000 index 00000000..6abd61fd --- /dev/null +++ b/zowe-galasa-intellij @@ -0,0 +1 @@ +Subproject commit 6abd61fd68b2227751c9bf19d7fc1808de0c48e9