Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 15 additions & 22 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ inputs:
description: 'IntelliJ IDEA version to test against. Keep in sync with matrix-setup in shared-test.yml'
required: false
default: '253.28294.334' # 2025.3 - should match first version in shared-test.yml
skip-jcef:
description: 'Skip JCEF package (set to true for release/verifyPlugin jobs). Default is false.'
required: false
default: 'false'
gradle-cache-read-only:
description: 'Use read-only Gradle cache (for non-main branches or matrix jobs). Default is true.'
required: false
default: 'true'
github-token:
description: 'GitHub token for API access (required for setup-java to download JBR)'
required: true
build-scan-publish:
description: 'Whether to publish Gradle build scans'
required: false
default: 'false'

runs:
using: composite
Expand All @@ -34,46 +34,39 @@ runs:
id: free-disk-space
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false
tool-cache: false
large-packages: false

- name: Cache JetBrains JDK
id: cache-jdk
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: /opt/hostedtoolcache/Java_JetBrains_*
key: jdk-${{ runner.os }}-${{ runner.arch }}-jetbrains-21-${{ inputs.skip-jcef == 'false' && 'jcef' || 'nojcef' }}
key: jdk-${{ runner.os }}-${{ runner.arch }}-jetbrains-21

- name: Setup JBR 21
id: setup-java
uses: actions/setup-java@v5
with:
distribution: 'jetbrains'
java-version: 21
java-package: ${{ inputs.skip-jcef == 'false' && 'jdk+jcef' || 'jdk' }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
java-package: 'jdk'
token: ${{ inputs.github-token }}

- name: Setup Gradle
id: setup-gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: ${{ inputs.gradle-cache-read-only == 'true' }}
cache-overwrite-existing: false
gradle-home-cache-cleanup: true
cache-read-only: true
add-job-summary-as-pr-comment: 'on-failure'
# # Exclude IntelliJ IDE downloads and extractions from cache (~10GB)
# # These are fast to re-download and would bloat the cache
# gradle-home-cache-excludes: |
# caches/modules-2/files-2.1/idea
# caches/*/transforms
build-scan-publish: true
build-scan-publish: ${{ inputs.build-scan-publish }}
build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service'
build-scan-terms-of-use-agree: 'yes'
github-token: ${{ inputs.github-token }}

- name: Restore Elixir cache
id: cache-elixir-restore
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: |
cache/elixir-${{ inputs.elixir-version }}-intellij_elixir-2.1.0/_build
Expand Down Expand Up @@ -105,7 +98,7 @@ runs:
- name: Save Elixir cache
id: cache-elixir-save
if: always() && inputs.gradle-cache-read-only != 'true' && steps.cache-elixir-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: |
cache/elixir-${{ inputs.elixir-version }}-intellij_elixir-2.1.0/_build
Expand Down
20 changes: 10 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ updates:
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 5
semver-major-days: 30
semver-minor-days: 7
semver-patch-days: 3
# cooldown:
# default-days: 5
# semver-major-days: 30
# semver-minor-days: 7
# semver-patch-days: 3
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 5
semver-major-days: 30
semver-minor-days: 7
semver-patch-days: 3
# cooldown:
# default-days: 5
# semver-major-days: 30
# semver-minor-days: 7
# semver-patch-days: 3
1 change: 0 additions & 1 deletion .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
id: setup-env
uses: ./.github/actions/setup-env
with:
skip-jcef: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Download Release Asset
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
id: setup-env
uses: ./.github/actions/setup-env
with:
elixir-version: ''
skip-jcef: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build with Gradle
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/shared-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
elixir-version: ${{ inputs.elixir-version || '1.13.4' }}
otp-version: ${{ inputs.otp-version || '24.3.4.6' }}
idea-version: ${{ matrix.idea-version }}
gradle-cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-cache-read-only: true
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
Expand Down Expand Up @@ -111,13 +111,12 @@ jobs:
uses: ./.github/actions/setup-env
with:
idea-version: ${{ matrix.idea-version }}
gradle-cache-read-only: ${{ github.ref != 'refs/heads/main' }}
skip-jcef: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}
build-scan-publish: true

- name: Run Plugin Verifier
id: verify-plugin
run: ./gradlew --stacktrace verifyPlugin
run: ./gradlew verifyPlugin

- name: Upload Verify Reports
id: upload-verify-reports
Expand Down
6 changes: 0 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,6 @@ val getQuoter by tasks.registering(Download::class) {
val unzipQuoter by tasks.registering(Copy::class) {
dependsOn(getQuoter)

// Prevent Gradle from snapshotting destination (may contain Erlang named pipes from previous runs)
doNotTrackState("Destination may contain named pipes from Erlang runtime")

// 1. Target the final destination directly
into(quoterUnzippedPath)

Expand Down Expand Up @@ -398,9 +395,6 @@ val getQuoterDeps by tasks.registering(Exec::class) {
val releaseQuoter by tasks.registering(Exec::class) {
dependsOn(getQuoterDeps)

// Prevent caching - _build directory may contain Erlang named pipes
doNotTrackState("Build directory contains Erlang named pipes that cannot be cached")

// 1. Use Directory object directly (No .asFile)
workingDir(quoterUnzippedPath)

Expand Down
63 changes: 63 additions & 0 deletions tests/org/elixir_lang/quoter/PipeLocationTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.elixir_lang.quoter

import junit.framework.TestCase
import java.io.File

/**
* Verifies that the quoter daemon creates pipes in cache/quoter_tmp_*
* instead of inside _build/ (which breaks Gradle caching).
*/
class PipeLocationTest : TestCase() {

fun testPipesNotInBuildDirectory() {
val projectRoot = File(System.getProperty("user.dir"))
val cacheDir = File(projectRoot, "cache")

// Find any _build directories in cache
val buildDirs = cacheDir.listFiles { file ->
file.isDirectory && file.name.contains("intellij_elixir")
}?.flatMap { quoterDir ->
File(quoterDir, "_build").walkTopDown()
.filter { it.name == "pipe" && it.isDirectory }
.toList()
} ?: emptyList()

// Check no pipes exist in _build
for (pipeDir in buildDirs) {
val pipes = pipeDir.listFiles { f -> f.name.startsWith("erlang.pipe") } ?: emptyArray()
assertTrue(
"Found pipes in _build directory: ${pipeDir.absolutePath}. " +
"Pipes should be in cache/quoter_tmp_* via RELEASE_TMP.",
pipes.isEmpty()
)
}
}

fun testPipesInQuoterTmpDirectory() {
val projectRoot = File(System.getProperty("user.dir"))
val cacheDir = File(projectRoot, "cache")

// Find quoter_tmp_* directories
val quoterTmpDirs = cacheDir.listFiles { file ->
file.isDirectory && file.name.startsWith("quoter_tmp_")
} ?: emptyArray()

assertTrue(
"No quoter_tmp_* directory found in cache/. " +
"Expected RELEASE_TMP to create cache/quoter_tmp_<version>/",
quoterTmpDirs.isNotEmpty()
)

// Check at least one has pipes (quoter should be running during tests)
val hasPipes = quoterTmpDirs.any { tmpDir ->
val pipeDir = File(tmpDir, "pipe")
pipeDir.exists() && (pipeDir.listFiles()?.isNotEmpty() == true)
}

assertTrue(
"No pipes found in any quoter_tmp_*/pipe/ directory. " +
"Is the quoter daemon running?",
hasPipes
)
}
}
Loading