Skip to content

Commit fd791ef

Browse files
authored
fix(ci): cannot build (#31)
Error Message: "System.IO.IOException: No space left on device : '/home/runner/runners/2.314.1/_diag/Worker_20240319-092839-utc.log'" Ref: actions/runner-images#9494 Signed-off-by: Kevin Cui <[email protected]> * fixup! fix(ci): cannot build --------- Signed-off-by: Kevin Cui <[email protected]>
1 parent f9269d4 commit fd791ef

File tree

2 files changed

+191
-73
lines changed

2 files changed

+191
-73
lines changed

.github/workflows/build.yml

+171-59
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,61 @@
1-
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
2-
# - validate Gradle Wrapper,
3-
# - run 'test' and 'verifyPlugin' tasks,
4-
# - run Qodana inspections,
5-
# - run 'buildPlugin' task and prepare artifact for the further tests,
6-
# - run 'runPluginVerifier' task,
7-
# - create a draft release.
1+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2+
# - Validate Gradle Wrapper.
3+
# - Run 'test' and 'verifyPlugin' tasks.
4+
# - Run Qodana inspections.
5+
# - Run the 'buildPlugin' task and prepare artifact for further tests.
6+
# - Run the 'runPluginVerifier' task.
7+
# - Create a draft release.
88
#
9-
# Workflow is triggered on push and pull_request events.
9+
# The workflow is triggered on push and pull_request events.
1010
#
1111
# GitHub Actions reference: https://help.github.com/en/actions
1212
#
1313
## JBIJPPTPL
1414

1515
name: Build
1616
on:
17-
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
17+
# 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

23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
2327
jobs:
2428

25-
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
26-
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
27-
# Build plugin and provide the artifact for the next workflow jobs
29+
# Prepare environment and build the plugin
2830
build:
2931
name: Build
3032
runs-on: ubuntu-latest
3133
outputs:
3234
version: ${{ steps.properties.outputs.version }}
3335
changelog: ${{ steps.properties.outputs.changelog }}
36+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3437
steps:
3538

36-
# Free GitHub Actions Environment Disk Space
37-
- name: Maximize Build Space
38-
run: |
39-
sudo rm -rf /usr/share/dotnet
40-
sudo rm -rf /usr/local/lib/android
41-
sudo rm -rf /opt/ghc
42-
4339
# Check out current repository
4440
- name: Fetch Sources
45-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4642

4743
# Validate wrapper
4844
- name: Gradle Wrapper Validation
49-
uses: gradle/wrapper-validation-action@v1.0.5
45+
uses: gradle/wrapper-validation-action@v2
5046

51-
# Setup Java 11 environment for the next steps
47+
# Set up Java environment for the next steps
5248
- name: Setup Java
53-
uses: actions/setup-java@v3
49+
uses: actions/setup-java@v4
5450
with:
5551
distribution: zulu
56-
java-version: 11
52+
java-version: 17
53+
54+
# Setup Gradle
55+
- name: Setup Gradle
56+
uses: gradle/actions/setup-gradle@v3
57+
with:
58+
gradle-home-cache-cleanup: true
5759

5860
# Set environment variables
5961
- name: Export Properties
@@ -62,37 +64,20 @@ jobs:
6264
run: |
6365
PROPERTIES="$(./gradlew properties --console=plain -q)"
6466
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
65-
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
6667
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
67-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
68-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
69-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
7068
71-
echo "::set-output name=version::$VERSION"
72-
echo "::set-output name=name::$NAME"
73-
echo "::set-output name=changelog::$CHANGELOG"
74-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
69+
echo "version=$VERSION" >> $GITHUB_OUTPUT
70+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
71+
72+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
73+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
74+
echo "EOF" >> $GITHUB_OUTPUT
7575
7676
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
7777
78-
# Cache Plugin Verifier IDEs
79-
- name: Setup Plugin Verifier IDEs Cache
80-
uses: actions/cache@v3
81-
with:
82-
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
83-
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
84-
85-
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
86-
- name: Run Plugin Verification tasks
87-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
88-
89-
# Collect Plugin Verifier Result
90-
- name: Collect Plugin Verifier Result
91-
if: ${{ always() }}
92-
uses: actions/upload-artifact@v3
93-
with:
94-
name: pluginVerifier-result
95-
path: ${{ github.workspace }}/build/reports/pluginVerifier
78+
# Build plugin
79+
- name: Build plugin
80+
run: ./gradlew buildPlugin
9681

9782
# Prepare plugin archive content for creating artifact
9883
- name: Prepare Plugin Artifact
@@ -103,31 +88,158 @@ jobs:
10388
FILENAME=`ls *.zip`
10489
unzip "$FILENAME" -d content
10590
106-
echo "::set-output name=filename::${FILENAME:0:-4}"
91+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
10792
10893
# Store already-built plugin as an artifact for downloading
10994
- name: Upload artifact
110-
uses: actions/upload-artifact@v3
95+
uses: actions/upload-artifact@v4
11196
with:
11297
name: ${{ steps.artifact.outputs.filename }}
11398
path: ./build/distributions/content/*/*
11499

100+
# Run tests and upload a code coverage report
101+
test:
102+
name: Test
103+
needs: [ build ]
104+
runs-on: ubuntu-latest
105+
steps:
106+
107+
# Check out current repository
108+
- name: Fetch Sources
109+
uses: actions/checkout@v4
110+
111+
# Set up Java environment for the next steps
112+
- name: Setup Java
113+
uses: actions/setup-java@v4
114+
with:
115+
distribution: zulu
116+
java-version: 17
117+
118+
# Setup Gradle
119+
- name: Setup Gradle
120+
uses: gradle/actions/setup-gradle@v3
121+
with:
122+
gradle-home-cache-cleanup: true
123+
124+
# Run tests
125+
- name: Run Tests
126+
run: ./gradlew check
127+
128+
# Collect Tests Result of failed tests
129+
- name: Collect Tests Result
130+
if: ${{ failure() }}
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: tests-result
134+
path: ${{ github.workspace }}/build/reports/tests
135+
136+
# Upload the Kover report to CodeCov
137+
- name: Upload Code Coverage Report
138+
uses: codecov/codecov-action@v4
139+
with:
140+
files: ${{ github.workspace }}/build/reports/kover/report.xml
141+
142+
# Run Qodana inspections and provide report
143+
inspectCode:
144+
name: Inspect code
145+
needs: [ build ]
146+
runs-on: ubuntu-latest
147+
permissions:
148+
contents: write
149+
checks: write
150+
pull-requests: write
151+
steps:
152+
153+
# Free GitHub Actions Environment Disk Space
154+
- name: Maximize Build Space
155+
uses: jlumbroso/free-disk-space@main
156+
with:
157+
tool-cache: false
158+
large-packages: false
159+
160+
# Check out current repository
161+
- name: Fetch Sources
162+
uses: actions/checkout@v4
163+
164+
# Set up Java environment for the next steps
165+
- name: Setup Java
166+
uses: actions/setup-java@v4
167+
with:
168+
distribution: zulu
169+
java-version: 17
170+
171+
# Run Qodana inspections
172+
- name: Qodana - Code Inspection
173+
uses: JetBrains/[email protected]
174+
with:
175+
cache-default-branch-only: true
176+
177+
# Run plugin structure verification along with IntelliJ Plugin Verifier
178+
verify:
179+
name: Verify plugin
180+
needs: [ build ]
181+
runs-on: ubuntu-latest
182+
steps:
183+
184+
# Free GitHub Actions Environment Disk Space
185+
- name: Maximize Build Space
186+
uses: jlumbroso/free-disk-space@main
187+
with:
188+
tool-cache: false
189+
large-packages: false
190+
191+
# Check out current repository
192+
- name: Fetch Sources
193+
uses: actions/checkout@v4
194+
195+
# Set up Java environment for the next steps
196+
- name: Setup Java
197+
uses: actions/setup-java@v4
198+
with:
199+
distribution: zulu
200+
java-version: 17
201+
202+
# Setup Gradle
203+
- name: Setup Gradle
204+
uses: gradle/actions/setup-gradle@v3
205+
with:
206+
gradle-home-cache-cleanup: true
207+
208+
# Cache Plugin Verifier IDEs
209+
- name: Setup Plugin Verifier IDEs Cache
210+
uses: actions/cache@v4
211+
with:
212+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
213+
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
214+
215+
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
216+
- name: Run Plugin Verification tasks
217+
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
218+
219+
# Collect Plugin Verifier Result
220+
- name: Collect Plugin Verifier Result
221+
if: ${{ always() }}
222+
uses: actions/upload-artifact@v4
223+
with:
224+
name: pluginVerifier-result
225+
path: ${{ github.workspace }}/build/reports/pluginVerifier
226+
115227
# Prepare a draft release for GitHub Releases page for the manual verification
116228
# If accepted and published, release workflow would be triggered
117229
releaseDraft:
118-
name: Release Draft
230+
name: Release draft
119231
if: github.event_name != 'pull_request'
120-
needs: build
232+
needs: [ build, test, inspectCode, verify ]
121233
runs-on: ubuntu-latest
122234
permissions:
123235
contents: write
124236
steps:
125237

126238
# Check out current repository
127239
- name: Fetch Sources
128-
uses: actions/checkout@v3
240+
uses: actions/checkout@v4
129241

130-
# Remove old release drafts by using the curl request for the available releases with draft flag
242+
# Remove old release drafts by using the curl request for the available releases with a draft flag
131243
- name: Remove Old Release Drafts
132244
env:
133245
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -136,12 +248,12 @@ jobs:
136248
--jq '.[] | select(.draft == true) | .id' \
137249
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
138250
139-
# Create new release draft - which is not publicly visible and requires manual acceptance
251+
# Create a new release draft which is not publicly visible and requires manual acceptance
140252
- name: Create Release Draft
141253
env:
142254
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143255
run: |
144-
gh release create v${{ needs.build.outputs.version }} \
256+
gh release create "v${{ needs.build.outputs.version }}" \
145257
--draft \
146258
--title "v${{ needs.build.outputs.version }}" \
147259
--notes "$(cat << 'EOM'

.github/workflows/release.yml

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# GitHub Actions Workflow created for handling the release process based on the draft release prepared
2-
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
1+
# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
2+
# Running the publishPlugin task requires all following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
3+
# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.
34

45
name: Release
56
on:
@@ -8,7 +9,7 @@ on:
89

910
jobs:
1011

11-
# Prepare and publish the plugin to the Marketplace repository
12+
# Prepare and publish the plugin to JetBrains Marketplace repository
1213
release:
1314
name: Publish Plugin
1415
runs-on: ubuntu-latest
@@ -19,16 +20,22 @@ jobs:
1920

2021
# Check out current repository
2122
- name: Fetch Sources
22-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2324
with:
2425
ref: ${{ github.event.release.tag_name }}
2526

26-
# Setup Java 11 environment for the next steps
27+
# Set up Java environment for the next steps
2728
- name: Setup Java
28-
uses: actions/setup-java@v3
29+
uses: actions/setup-java@v4
2930
with:
3031
distribution: zulu
31-
java-version: 11
32+
java-version: 17
33+
34+
# Setup Gradle
35+
- name: Setup Gradle
36+
uses: gradle/actions/setup-gradle@v3
37+
with:
38+
gradle-home-cache-cleanup: true
3239

3340
# Set environment variables
3441
- name: Export Properties
@@ -40,11 +47,9 @@ jobs:
4047
EOM
4148
)"
4249
43-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
44-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
45-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
46-
47-
echo "::set-output name=changelog::$CHANGELOG"
50+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
51+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
52+
echo "EOF" >> $GITHUB_OUTPUT
4853
4954
# Update Unreleased section with the current release note
5055
- name: Patch Changelog
@@ -54,7 +59,7 @@ jobs:
5459
run: |
5560
./gradlew patchChangelog --release-note="$CHANGELOG"
5661
57-
# Publish the plugin to the Marketplace
62+
# Publish the plugin to JetBrains Marketplace
5863
- name: Publish Plugin
5964
env:
6065
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
@@ -69,7 +74,7 @@ jobs:
6974
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7075
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
7176

72-
# Create pull request
77+
# Create a pull request
7378
- name: Create Pull Request
7479
if: ${{ steps.properties.outputs.changelog != '' }}
7580
env:
@@ -88,6 +93,7 @@ jobs:
8893
8994
gh label create "$LABEL" \
9095
--description "Pull requests with release changelog update" \
96+
--force \
9197
|| true
9298
9399
gh pr create \

0 commit comments

Comments
 (0)