-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Actions: Build workflow refactoring
- Loading branch information
Showing
1 changed file
with
81 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,21 @@ name: Build | |
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
branches: [ master ] | ||
pull_request: | ||
|
||
pull_request_target: | ||
types: [labeled] | ||
types: [ labeled ] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.properties.outputs.version }} | ||
changelog: ${{ steps.properties.outputs.changelog }} | ||
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} | ||
steps: | ||
- name: Maximize Build Space | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /opt/ghc | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
|
||
|
@@ -34,6 +29,11 @@ jobs: | |
distribution: zulu | ||
java-version: 11 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Export Properties | ||
id: properties | ||
run: | | ||
|
@@ -49,6 +49,51 @@ jobs: | |
./gradlew listProductsReleases | ||
- name: Build plugin | ||
run: ./gradlew buildPlugin | ||
|
||
- name: Prepare Plugin Artifact | ||
id: artifact | ||
shell: bash | ||
run: | | ||
cd ${{ github.workspace }}/build/distributions | ||
FILENAME=`ls *.zip` | ||
unzip "$FILENAME" -d content | ||
echo "::set-output name=filename::${FILENAME:0:-4}" | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.artifact.outputs.filename }} | ||
path: ./build/distributions/content/*/* | ||
|
||
- name: Notify to Telegram | ||
uses: yanzay/[email protected] | ||
if: always() | ||
with: | ||
chat: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
status: ${{ job.status }} | ||
|
||
test: | ||
name: Test | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 11 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Run Tests | ||
run: ./gradlew test | ||
|
||
|
@@ -62,14 +107,39 @@ jobs: | |
- name: Test generated vaults with official CLI tool | ||
run: ./gradlew integrationTest | ||
|
||
verify: | ||
name: Verify plugin | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Maximize Build Space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
large-packages: false | ||
|
||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 11 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Setup Plugin Verifier IDEs Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides | ||
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} | ||
|
||
- name: Run Plugin Verification tasks | ||
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} | ||
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} | ||
|
||
- name: Collect Plugin Verifier Result | ||
if: always() | ||
|
@@ -78,35 +148,12 @@ jobs: | |
name: pluginVerifier-result | ||
path: ${{ github.workspace }}/build/reports/pluginVerifier | ||
|
||
- name: Prepare Plugin Artifact | ||
id: artifact | ||
shell: bash | ||
run: | | ||
cd ${{ github.workspace }}/build/distributions | ||
FILENAME=`ls *.zip` | ||
unzip "$FILENAME" -d content | ||
echo "::set-output name=filename::${FILENAME:0:-4}" | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.artifact.outputs.filename }} | ||
path: ./build/distributions/content/*/* | ||
|
||
- name: Notify to Telegram | ||
uses: yanzay/[email protected] | ||
if: always() | ||
with: | ||
chat: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
status: ${{ job.status }} | ||
|
||
# Prepare a draft release for GitHub Releases page for the manual verification | ||
# If accepted and published, release workflow would be triggered | ||
releaseDraft: | ||
name: Release Draft | ||
if: github.event_name != 'pull_request' | ||
needs: build | ||
needs: [ build, test, verify ] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|