Skip to content

Commit

Permalink
Try to save dependencies as artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelldi committed Nov 19, 2023
1 parent 5adfb88 commit a81f383
Showing 1 changed file with 96 additions and 63 deletions.
159 changes: 96 additions & 63 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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)"
Expand All @@ -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
Expand All @@ -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
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

0 comments on commit a81f383

Please sign in to comment.