From 37982fe10735f1d1463631ad1bc7fe47a83acbce Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Thu, 9 Oct 2025 19:17:33 -0400 Subject: [PATCH 1/3] Use new runner --- .github/settings.xml | 27 -------- .github/setup_global_resolver.sh | 112 +++++++++++++++++++++++++++++++ .github/workflows/build-test.yml | 3 + 3 files changed, 115 insertions(+), 27 deletions(-) delete mode 100644 .github/settings.xml create mode 100755 .github/setup_global_resolver.sh diff --git a/.github/settings.xml b/.github/settings.xml deleted file mode 100644 index 85b8e38..0000000 --- a/.github/settings.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - akka-github-actions - - - akka-repository - Akka library repository - - https://repo.akka.io/maven/github_actions - - - - - akka-repository - Akka library repository - - https://repo.akka.io/maven/github_actions - - - - - - akka-github-actions - - diff --git a/.github/setup_global_resolver.sh b/.github/setup_global_resolver.sh new file mode 100755 index 0000000..7e6b92d --- /dev/null +++ b/.github/setup_global_resolver.sh @@ -0,0 +1,112 @@ +#!/bin/bash + +# .github/script.sh: Adds the Akka repository globally for sbt and Maven. + +# Fail on any error, reference undefined variables, and prevent pipeline failures +set -euo pipefail + +# --- Configuration --- +AKKA_RESOLVER_URL='https://repo.akka.io/maven/github_actions' +RESOLVER_LINE="resolvers += \"Akka library repository\" at \"$AKKA_RESOLVER_URL\"" +# Uses GITHUB_WORKSPACE (set by the runner) or defaults to the current directory if run locally +TESTS_BASE_DIR="${GITHUB_WORKSPACE:-.}/sbt-plugin/src/sbt-test/sbt-kalix" + +# ---------------------------------------- + +## Setup for sbt +setup_sbt() { + echo "--- Setting up Akka resolver for sbt global configuration (~/.sbt/1.0/resolvers.sbt)" + mkdir -p ~/.sbt/1.0 + echo "$RESOLVER_LINE" >> ~/.sbt/1.0/resolvers.sbt + echo "✅ Added resolver to ~/.sbt/1.0/resolvers.sbt" +} + +## Setup for Scripted Tests +setup_scripted_tests() { + echo -e "\n--- Setting up Akka resolver for sbt scripted tests (globally per test case)" + + if [ ! -d "$TESTS_BASE_DIR" ]; then + echo "⚠️ Warning: Tests directory not found: $TESTS_BASE_DIR. Skipping setup for scripted tests." + return 0 + fi + + echo "Scanning test cases in: $TESTS_BASE_DIR" + + # Use nullglob to handle directories with no contents gracefully + shopt -s nullglob + for TEST_CASE in "$TESTS_BASE_DIR"/*/; do + if [ -d "$TEST_CASE" ]; then + TARGET_DIR="${TEST_CASE}global" + RESOLVERS_FILE="${TARGET_DIR}/resolvers.sbt" + + mkdir -p "$TARGET_DIR" + echo "$RESOLVER_LINE" > "$RESOLVERS_FILE" + echo "-> Created $RESOLVERS_FILE" + fi + done + shopt -u nullglob # Turn nullglob back off + echo "✅ Finished setting up resolvers for sbt scripted tests." +} + +## Setup for Maven +setup_maven() { + echo -e "\n--- Setting up Akka resolver for Maven global configuration (~/.m2/settings.xml)" + mkdir -p ~/.m2 + + # Create the settings.xml file with the Akka repository configuration + cat > ~/.m2/settings.xml < + + + akka-repo-redirect + akka-repository + $AKKA_RESOLVER_URL + + + external:http:* + Pseudo repository to mirror external repositories initially using HTTP. + http://0.0.0.0/ + true + maven-default-http-blocker + + + + + + akka-repo + + + akka-repository + $AKKA_RESOLVER_URL + + + + + + akka-plugin-repository + $AKKA_RESOLVER_URL + + + + + + + akka-repo + + +EOF + echo "✅ Created/Overwrote ~/.m2/settings.xml with Akka repository configuration." +} + +# --- Main Execution --- +main() { + setup_sbt + setup_scripted_tests + setup_maven + echo -e "\n🎉 Akka resolvers setup complete." +} + +main \ No newline at end of file diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 984c03a..d89159f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -43,6 +43,9 @@ jobs: with: jvm: temurin:1.21 + - name: Setup global resolver + run: ./.github/setup_global_resolver.sh + - name: mvn test run: |- mvn test --no-transfer-progress From ac6c28f276cc9843d91384bddbd2a3043d4b064b Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Mon, 13 Oct 2025 23:56:35 -0400 Subject: [PATCH 2/3] Update build-test.yml --- .github/workflows/build-test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d89159f..ccef7bb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -43,8 +43,16 @@ jobs: with: jvm: temurin:1.21 + - name: Checkout Global Scripts + uses: actions/checkout@v4 + with: + repository: akka/github-actions-scripts + path: scripts + - name: Setup global resolver - run: ./.github/setup_global_resolver.sh + run: | + chmod +x ./scripts/setup_global_resolver.sh + ./scripts/setup_global_resolver.sh - name: mvn test run: |- From 38e609f121b7549b806ab69732b952d717dfc815 Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Mon, 13 Oct 2025 23:59:04 -0400 Subject: [PATCH 3/3] Delete .github/setup_global_resolver.sh --- .github/setup_global_resolver.sh | 112 ------------------------------- 1 file changed, 112 deletions(-) delete mode 100755 .github/setup_global_resolver.sh diff --git a/.github/setup_global_resolver.sh b/.github/setup_global_resolver.sh deleted file mode 100755 index 7e6b92d..0000000 --- a/.github/setup_global_resolver.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash - -# .github/script.sh: Adds the Akka repository globally for sbt and Maven. - -# Fail on any error, reference undefined variables, and prevent pipeline failures -set -euo pipefail - -# --- Configuration --- -AKKA_RESOLVER_URL='https://repo.akka.io/maven/github_actions' -RESOLVER_LINE="resolvers += \"Akka library repository\" at \"$AKKA_RESOLVER_URL\"" -# Uses GITHUB_WORKSPACE (set by the runner) or defaults to the current directory if run locally -TESTS_BASE_DIR="${GITHUB_WORKSPACE:-.}/sbt-plugin/src/sbt-test/sbt-kalix" - -# ---------------------------------------- - -## Setup for sbt -setup_sbt() { - echo "--- Setting up Akka resolver for sbt global configuration (~/.sbt/1.0/resolvers.sbt)" - mkdir -p ~/.sbt/1.0 - echo "$RESOLVER_LINE" >> ~/.sbt/1.0/resolvers.sbt - echo "✅ Added resolver to ~/.sbt/1.0/resolvers.sbt" -} - -## Setup for Scripted Tests -setup_scripted_tests() { - echo -e "\n--- Setting up Akka resolver for sbt scripted tests (globally per test case)" - - if [ ! -d "$TESTS_BASE_DIR" ]; then - echo "⚠️ Warning: Tests directory not found: $TESTS_BASE_DIR. Skipping setup for scripted tests." - return 0 - fi - - echo "Scanning test cases in: $TESTS_BASE_DIR" - - # Use nullglob to handle directories with no contents gracefully - shopt -s nullglob - for TEST_CASE in "$TESTS_BASE_DIR"/*/; do - if [ -d "$TEST_CASE" ]; then - TARGET_DIR="${TEST_CASE}global" - RESOLVERS_FILE="${TARGET_DIR}/resolvers.sbt" - - mkdir -p "$TARGET_DIR" - echo "$RESOLVER_LINE" > "$RESOLVERS_FILE" - echo "-> Created $RESOLVERS_FILE" - fi - done - shopt -u nullglob # Turn nullglob back off - echo "✅ Finished setting up resolvers for sbt scripted tests." -} - -## Setup for Maven -setup_maven() { - echo -e "\n--- Setting up Akka resolver for Maven global configuration (~/.m2/settings.xml)" - mkdir -p ~/.m2 - - # Create the settings.xml file with the Akka repository configuration - cat > ~/.m2/settings.xml < - - - akka-repo-redirect - akka-repository - $AKKA_RESOLVER_URL - - - external:http:* - Pseudo repository to mirror external repositories initially using HTTP. - http://0.0.0.0/ - true - maven-default-http-blocker - - - - - - akka-repo - - - akka-repository - $AKKA_RESOLVER_URL - - - - - - akka-plugin-repository - $AKKA_RESOLVER_URL - - - - - - - akka-repo - - -EOF - echo "✅ Created/Overwrote ~/.m2/settings.xml with Akka repository configuration." -} - -# --- Main Execution --- -main() { - setup_sbt - setup_scripted_tests - setup_maven - echo -e "\n🎉 Akka resolvers setup complete." -} - -main \ No newline at end of file