Skip to content

Commit b7fbe05

Browse files
authored
optimize workflow (#6)
* optimize workflow disk space * free disk space * Fix plugin verifier cache
1 parent 836d9bf commit b7fbe05

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name: Build
1616
on:
1717
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
1818
push:
19-
branches: [ main ]
19+
branches: [main]
2020
# Trigger the workflow on any pull request
2121
pull_request:
2222

@@ -25,16 +25,20 @@ concurrency:
2525
cancel-in-progress: true
2626

2727
jobs:
28-
2928
# Prepare environment and build the plugin
3029
build:
3130
name: Build
3231
runs-on: ubuntu-latest
3332
outputs:
3433
version: ${{ steps.properties.outputs.version }}
35-
changelog: ${{ steps.properties.outputs.changelog }}
3634
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3735
steps:
36+
# Free GitHub Actions Environment Disk Space
37+
- name: Maximize Build Space
38+
uses: jlumbroso/free-disk-space@main
39+
with:
40+
tool-cache: false
41+
large-packages: false
3842

3943
# Check out the current repository
4044
- name: Fetch Sources
@@ -57,6 +61,14 @@ jobs:
5761
with:
5862
gradle-home-cache-cleanup: true
5963

64+
# Set environment variables
65+
- name: Export Properties
66+
id: properties
67+
shell: bash
68+
run: |
69+
PROPERTIES="$(./gradlew properties --console=plain -q)"
70+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
71+
6072
# Build plugin
6173
- name: Build plugin
6274
run: ./gradlew buildPlugin
@@ -82,9 +94,15 @@ jobs:
8294
# Run tests and upload a code coverage report
8395
test:
8496
name: Test
85-
needs: [ build ]
97+
needs: [build]
8698
runs-on: ubuntu-latest
8799
steps:
100+
# Free GitHub Actions Environment Disk Space
101+
- name: Maximize Build Space
102+
uses: jlumbroso/free-disk-space@main
103+
with:
104+
tool-cache: false
105+
large-packages: false
88106

89107
# Check out the current repository
90108
- name: Fetch Sources
@@ -118,10 +136,9 @@ jobs:
118136
# Run plugin structure verification along with IntelliJ Plugin Verifier
119137
verify:
120138
name: Verify plugin
121-
needs: [ build ]
139+
needs: [build]
122140
runs-on: ubuntu-latest
123141
steps:
124-
125142
# Free GitHub Actions Environment Disk Space
126143
- name: Maximize Build Space
127144
uses: jlumbroso/free-disk-space@main
@@ -151,7 +168,7 @@ jobs:
151168
uses: actions/cache@v4
152169
with:
153170
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
154-
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
171+
key: plugin-verifier
155172

156173
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
157174
- name: Run Plugin Verification tasks

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ jobs:
1515
env:
1616
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
steps:
18+
# Free GitHub Actions Environment Disk Space
19+
- name: Maximize Build Space
20+
uses: jlumbroso/free-disk-space@main
21+
with:
22+
tool-cache: false
23+
large-packages: false
24+
1825
# Check out current repository
1926
- name: Fetch Sources
2027
uses: actions/checkout@v4
@@ -48,4 +55,5 @@ jobs:
4855
PROJECT_NAME="$(basename ${{ github.repository }})"
4956
PKG="$PROJECT_NAME-${VERSION:1}.zip"
5057
ls -l "$DIST_DIR"
51-
gh release create ${{ github.ref_name }} "$DIST_DIR/$PKG" --generate-notes
58+
gh release create ${{ github.ref_name }} "$DIST_DIR/$PKG" --generate-notes
59+

0 commit comments

Comments
 (0)