Skip to content

Commit

Permalink
Disable build cache since Github Action runners fail with 'no space l…
Browse files Browse the repository at this point in the history
…eft on device' (#10409) (#10677)

(cherry picked from commit e4c477a)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 4dcad6d commit 7d7ea20
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Gradle Assemble
on: [pull_request]

jobs:
assemble:
if: github.repository == 'opensearch-project/OpenSearch'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
colima start
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Run Gradle (assemble)
run: |
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE
11 changes: 1 addition & 10 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gradle Precommit and Assemble
name: Gradle Precommit
on: [pull_request]

jobs:
Expand All @@ -19,12 +19,3 @@ jobs:
- name: Run Gradle (precommit)
run: |
./gradlew javadoc precommit --parallel
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
colima start
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Run Gradle (assemble)
run: |
./gradlew assemble --parallel
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ plugins {
id "com.gradle.enterprise" version "3.14.1"
}

ext.disableBuildCache = hasProperty('DISABLE_BUILD_CACHE') || System.getenv().containsKey('DISABLE_BUILD_CACHE')

buildCache {
local {
enabled = true
enabled = !disableBuildCache
removeUnusedEntriesAfterDays = 14
}
}
Expand Down

0 comments on commit 7d7ea20

Please sign in to comment.