diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c691b57d9f..0ee901c7eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,13 +25,9 @@ on: jobs: # Prepare environment and build the plugin - build: - name: Build + build-dependencies: + name: Build Dependencies runs-on: ubuntu-latest - outputs: - version: ${{ steps.properties.outputs.version }} - changelog: ${{ steps.properties.outputs.changelog }} - pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} steps: # Check out Maven Plugins for Azure Services repository @@ -48,7 +44,7 @@ jobs: with: path: azure-tools-for-intellij - # Setup Java environment for the next steps + # Setup Java environment - name: Setup Java uses: actions/setup-java@v3 with: @@ -73,11 +69,48 @@ jobs: export JAVA_HOME=$JAVA_HOME_17_X64 ./mvnw install -DskipTests -f Utils/pom.xml + # Upload Maven Plugins and Utils artifacts + - name: Upload library artifacts + uses: actions/upload-artifact@v3 + with: + name: library-artifacts + path: /home/runner/.m2/ + retention-days: 1 + + # Prepare environment and build the plugin + build: + name: Build + needs: [ build-dependencies ] + runs-on: ubuntu-latest + outputs: + version: ${{ steps.properties.outputs.version }} + changelog: ${{ steps.properties.outputs.changelog }} + pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} + steps: + + # Download Maven Plugins and Utils artifacts + - name: Download library artifacts + uses: actions/download-artifact@v3 + with: + name: library-artifacts + path: /home/runner/.m2/ + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v4 + + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 17 + # Setup Gradle - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - build-root-directory: ${{ github.workspace }}/azure-tools-for-intellij/PluginsAndFeatures/azure-toolkit-for-rider + build-root-directory: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider gradle-home-cache-cleanup: true # Setup .NET 8 environment for the next steps @@ -89,7 +122,7 @@ jobs: # Set environment variables - name: Export Properties id: properties - working-directory: ${{ github.workspace }}/azure-tools-for-intellij/PluginsAndFeatures/azure-toolkit-for-rider + working-directory: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider shell: bash run: | PROPERTIES="$(./gradlew properties --console=plain -q)" @@ -107,13 +140,13 @@ jobs: # Build plugin - name: Build plugin - working-directory: ${{ github.workspace }}/azure-tools-for-intellij/PluginsAndFeatures/azure-toolkit-for-rider + working-directory: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider run: ./gradlew buildPlugin # Prepare plugin archive content for creating artifact - name: Prepare Plugin Artifact id: artifact - working-directory: ${{ github.workspace }}/azure-tools-for-intellij/PluginsAndFeatures/azure-toolkit-for-rider + working-directory: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider shell: bash run: | cd ./build/distributions @@ -127,55 +160,55 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ steps.artifact.outputs.filename }} - path: ${{ github.workspace }}/azure-tools-for-intellij/PluginsAndFeatures/azure-toolkit-for-rider/build/distributions/content/*/* - - # Run plugin structure verification along with IntelliJ Plugin Verifier - verify: - name: Verify plugin - needs: [ build ] - runs-on: ubuntu-latest - steps: - - # Free GitHub Actions Environment Disk Space - - name: Maximize Build Space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - large-packages: false - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v4 - - # Set up Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 17 - - # Set up Gradle - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - # Cache Plugin Verifier IDEs - - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v3 - with: - path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides - key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} - - # Run Verify Plugin task and IntelliJ Plugin Verifier tool - - name: Run Plugin Verification tasks - working-directory: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider - run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} - - # Collect Plugin Verifier Result - - name: Collect Plugin Verifier Result - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: pluginVerifier-result - path: ${{ github.workspace }}/build/reports/pluginVerifier \ No newline at end of file + path: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider/build/distributions/content/*/* + +# # Run plugin structure verification along with IntelliJ Plugin Verifier +# verify: +# name: Verify plugin +# needs: [ build ] +# runs-on: ubuntu-latest +# steps: +# +# # Free GitHub Actions Environment Disk Space +# - name: Maximize Build Space +# uses: jlumbroso/free-disk-space@main +# with: +# tool-cache: false +# large-packages: false +# +# # Check out current repository +# - name: Fetch Sources +# uses: actions/checkout@v4 +# +# # Set up Java environment for the next steps +# - name: Setup Java +# uses: actions/setup-java@v3 +# with: +# distribution: zulu +# java-version: 17 +# +# # Set up Gradle +# - name: Setup Gradle +# uses: gradle/gradle-build-action@v2 +# with: +# gradle-home-cache-cleanup: true +# +# # Cache Plugin Verifier IDEs +# - name: Setup Plugin Verifier IDEs Cache +# uses: actions/cache@v3 +# with: +# path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides +# key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} +# +# # Run Verify Plugin task and IntelliJ Plugin Verifier tool +# - name: Run Plugin Verification tasks +# working-directory: ${{ github.workspace }}/PluginsAndFeatures/azure-toolkit-for-rider +# run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} +# +# # Collect Plugin Verifier Result +# - name: Collect Plugin Verifier Result +# if: ${{ always() }} +# uses: actions/upload-artifact@v3 +# with: +# name: pluginVerifier-result +# path: ${{ github.workspace }}/build/reports/pluginVerifier \ No newline at end of file