From 3708da76c7b7947203fcf0087f6edd0b5ead7bf4 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 11:23:45 -0400 Subject: [PATCH 01/12] ci: use codebuild and switch container to use ecr public mirror --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/unit-test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 43d5e2d..cfe6109 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,7 +6,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index f1f7a3b..86d8535 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -21,8 +21,8 @@ on: jobs: test: name: Run Test Suite - runs-on: ubuntu-latest - container: maven:3.9.9-amazoncorretto-21-debian + runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} + container: public.ecr.aws/docker/library/maven:3.9.9-amazoncorretto-21-debian env: SNAPSHOT: ${{ inputs.snapshot || '5.3.0-SNAPSHOT' }} CLEAN_INSTALL: ${{ inputs.clean_install || 'false' }} From d1e275bad91ce37667b9e9f9e0f6609db36882bf Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 11:36:24 -0400 Subject: [PATCH 02/12] fix: try fix --- .github/workflows/pre-commit.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index cfe6109..9a66f72 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,6 +7,7 @@ on: jobs: pre-commit: runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} + container: public.ecr.aws/docker/library/python:3.12-bookworm steps: - uses: actions/checkout@v4 @@ -29,11 +30,7 @@ jobs: echo "No client directory found, skipping frontend linting" fi - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.12.9' - + # Python 3.12 is provided by the container # Official pre-commit action handles caching automatically - uses: pre-commit/action@v3.0.1 with: From 4b95bbbcfc148481bc7132caf1432744bc6c0609 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 11:41:34 -0400 Subject: [PATCH 03/12] fix: pre-commit setup --- .github/workflows/pre-commit.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 9a66f72..df53c05 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -31,7 +31,17 @@ jobs: fi # Python 3.12 is provided by the container - # Official pre-commit action handles caching automatically - - uses: pre-commit/action@v3.0.1 + - name: Cache pre-commit environments + uses: actions/cache@v4 with: - extra_args: --all-files --show-diff-on-failure + path: ~/.cache/pre-commit + key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} + restore-keys: | + pre-commit-${{ runner.os }}- + + - name: Run pre-commit + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" + uv tool install pre-commit + uv tool run pre-commit run --all-files --show-diff-on-failure From e2555115dbdd0fa3885329bbe3910a1947cc8815 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 11:43:55 -0400 Subject: [PATCH 04/12] fix: pre-commit setup --- .github/workflows/pre-commit.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index df53c05..bb54d34 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -31,13 +31,17 @@ jobs: fi # Python 3.12 is provided by the container + - name: Compute pre-commit cache key + id: pc-key + run: echo "hash=$(sha256sum .pre-commit-config.yaml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + - name: Cache pre-commit environments uses: actions/cache@v4 with: path: ~/.cache/pre-commit - key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} + key: pre-commit-${{ steps.pc-key.outputs.hash }} restore-keys: | - pre-commit-${{ runner.os }}- + pre-commit- - name: Run pre-commit run: | From 6b1aa0100dfdbf1a5bdcf1b088d89f5a9e94d237 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 11:50:42 -0400 Subject: [PATCH 05/12] fix: pre-commit setup --- .github/workflows/pre-commit.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index bb54d34..fe3e592 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -43,6 +43,12 @@ jobs: restore-keys: | pre-commit- + - name: Install OpenJDK 21 headless (required by pretty-format-java hook) + run: | + apt-get update + apt-get install -y --no-install-recommends openjdk-21-jre-headless + java -version + - name: Run pre-commit run: | curl -LsSf https://astral.sh/uv/install.sh | sh From af74149ccb271cefd09c6dedb66f1e0cb564c36f Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 11:56:50 -0400 Subject: [PATCH 06/12] fix: pre-commit setup --- .github/workflows/pre-commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index fe3e592..a8afa1a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -43,10 +43,10 @@ jobs: restore-keys: | pre-commit- - - name: Install OpenJDK 21 headless (required by pretty-format-java hook) + - name: Install OpenJDK 17 headless (required by pretty-format-java hook) run: | apt-get update - apt-get install -y --no-install-recommends openjdk-21-jre-headless + apt-get install -y --no-install-recommends openjdk-17-jre-headless java -version - name: Run pre-commit From 2224c180de7129470417b3cb5b44bc05a55429ae Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 12:10:23 -0400 Subject: [PATCH 07/12] fix: theoretically fixed pre-commit, start to fix unit-test --- .github/workflows/pre-commit.yml | 48 ++++++++++++++++++++++---------- .github/workflows/unit-test.yml | 20 +++++++++++-- 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a8afa1a..0c16d40 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,16 +11,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '24' - - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10 - + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'pnpm' + cache-dependency-path: 'client/pnpm-lock.yaml' + - name: Install dependencies and run frontend linting run: | if [ -d "client" ]; then @@ -29,19 +31,30 @@ jobs: else echo "No client directory found, skipping frontend linting" fi - + # Python 3.12 is provided by the container - - name: Compute pre-commit cache key - id: pc-key - run: echo "hash=$(sha256sum .pre-commit-config.yaml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + - name: Compute cache keys + id: keys + run: | + echo "pre-commit=$(sha256sum .pre-commit-config.yaml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - - name: Cache pre-commit environments + - name: Cache pre-commit hook environments uses: actions/cache@v4 with: path: ~/.cache/pre-commit - key: pre-commit-${{ steps.pc-key.outputs.hash }} + key: pre-commit-py3.12-${{ steps.keys.outputs.pre-commit }} restore-keys: | - pre-commit- + pre-commit-py3.12- + + - name: Cache uv downloads + uses: actions/cache@v4 + with: + path: | + ~/.cache/uv + ~/.local/share/uv + key: uv-py3.12-${{ runner.os }} + restore-keys: | + uv-py3.12- - name: Install OpenJDK 17 headless (required by pretty-format-java hook) run: | @@ -49,9 +62,14 @@ jobs: apt-get install -y --no-install-recommends openjdk-17-jre-headless java -version + - name: Install uv + run: | + if ! command -v uv >/dev/null 2>&1; then + curl -LsSf https://astral.sh/uv/install.sh | sh + fi + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Run pre-commit run: | - curl -LsSf https://astral.sh/uv/install.sh | sh - export PATH="$HOME/.local/bin:$PATH" uv tool install pre-commit uv tool run pre-commit run --all-files --show-diff-on-failure diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 86d8535..62646a4 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -30,15 +30,29 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - + + # Computes a cache key from the root pom.xml. This project is a single-module + # Maven project, so hashing the root pom.xml alone is sufficient. + # + # For a multi-module Maven project, hash every pom.xml in the tree instead: + # run: echo "hash=$(find . -name pom.xml -not -path '*/target/*' -print0 \ + # | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + # + # Note: we compute the hash in a shell step instead of using the built-in + # hashFiles() expression because hashFiles() fails on this self-hosted + # CodeBuild runner due to a workspace-path resolution issue. + - name: Compute pom.xml hash + id: pom-hash + run: echo "hash=$(sha256sum pom.xml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + - name: Cache Maven packages id: cache-maven uses: actions/cache@v4 with: path: /root/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.SNAPSHOT }} + key: ${{ runner.os }}-maven-${{ steps.pom-hash.outputs.hash }}-${{ env.SNAPSHOT }} restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}- + ${{ runner.os }}-maven-${{ steps.pom-hash.outputs.hash }}- ${{ runner.os }}-maven- - name: Maven Install From 7026176720da18c937a5de14308748e40855e409 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 12:40:28 -0400 Subject: [PATCH 08/12] docs: docs --- .github/workflows/pre-commit.yml | 65 +++++--------------- .github/workflows/pre-commit.yml.disabled | 54 +++++++++++++++++ .github/workflows/unit-test.yml | 24 ++------ .github/workflows/unit-test.yml.disabled | 73 +++++++++++++++++++++++ 4 files changed, 147 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/pre-commit.yml.disabled create mode 100644 .github/workflows/unit-test.yml.disabled diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 0c16d40..43d5e2d 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,23 +6,20 @@ on: jobs: pre-commit: - runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} - container: public.ecr.aws/docker/library/python:3.12-bookworm + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '24' - cache: 'pnpm' - cache-dependency-path: 'client/pnpm-lock.yaml' - + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Install dependencies and run frontend linting run: | if [ -d "client" ]; then @@ -31,45 +28,13 @@ jobs: else echo "No client directory found, skipping frontend linting" fi - - # Python 3.12 is provided by the container - - name: Compute cache keys - id: keys - run: | - echo "pre-commit=$(sha256sum .pre-commit-config.yaml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - - - name: Cache pre-commit hook environments - uses: actions/cache@v4 + + - name: Set up Python + uses: actions/setup-python@v4 with: - path: ~/.cache/pre-commit - key: pre-commit-py3.12-${{ steps.keys.outputs.pre-commit }} - restore-keys: | - pre-commit-py3.12- - - - name: Cache uv downloads - uses: actions/cache@v4 + python-version: '3.12.9' + + # Official pre-commit action handles caching automatically + - uses: pre-commit/action@v3.0.1 with: - path: | - ~/.cache/uv - ~/.local/share/uv - key: uv-py3.12-${{ runner.os }} - restore-keys: | - uv-py3.12- - - - name: Install OpenJDK 17 headless (required by pretty-format-java hook) - run: | - apt-get update - apt-get install -y --no-install-recommends openjdk-17-jre-headless - java -version - - - name: Install uv - run: | - if ! command -v uv >/dev/null 2>&1; then - curl -LsSf https://astral.sh/uv/install.sh | sh - fi - echo "$HOME/.local/bin" >> "$GITHUB_PATH" - - - name: Run pre-commit - run: | - uv tool install pre-commit - uv tool run pre-commit run --all-files --show-diff-on-failure + extra_args: --all-files --show-diff-on-failure diff --git a/.github/workflows/pre-commit.yml.disabled b/.github/workflows/pre-commit.yml.disabled new file mode 100644 index 0000000..cd21b6e --- /dev/null +++ b/.github/workflows/pre-commit.yml.disabled @@ -0,0 +1,54 @@ +# ----------------------------------------------------------------------------- +# DISABLED WORKFLOW (kept for reference) +# +# This is the default pre-commit workflow intended to run on GitHub-hosted +# `ubuntu-latest` runners. It has been disabled by renaming the file to end in +# `.yml.disabled` so GitHub Actions will not discover or execute it. The active +# workflow used by this repo is `pre-commit.yml`, which targets the SEMOSS +# self-hosted CodeBuild runner (`codebuild-semoss-github-runner-...`). +# +# To restore this default workflow (e.g., if migrating back to GitHub-hosted +# runners), rename this file back to `pre-commit-default.yml` and remove or +# rename the self-hosted variant. +# ----------------------------------------------------------------------------- + +name: Pre-commit + +on: + pull_request: + workflow_dispatch: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Install dependencies and run frontend linting + run: | + if [ -d "client" ]; then + pnpm install + pnpm exec biome format --write && pnpm exec biome lint + else + echo "No client directory found, skipping frontend linting" + fi + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12.9' + + # Official pre-commit action handles caching automatically + - uses: pre-commit/action@v3.0.1 + with: + extra_args: --all-files --show-diff-on-failure diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 62646a4..f1f7a3b 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -21,8 +21,8 @@ on: jobs: test: name: Run Test Suite - runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} - container: public.ecr.aws/docker/library/maven:3.9.9-amazoncorretto-21-debian + runs-on: ubuntu-latest + container: maven:3.9.9-amazoncorretto-21-debian env: SNAPSHOT: ${{ inputs.snapshot || '5.3.0-SNAPSHOT' }} CLEAN_INSTALL: ${{ inputs.clean_install || 'false' }} @@ -30,29 +30,15 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - # Computes a cache key from the root pom.xml. This project is a single-module - # Maven project, so hashing the root pom.xml alone is sufficient. - # - # For a multi-module Maven project, hash every pom.xml in the tree instead: - # run: echo "hash=$(find . -name pom.xml -not -path '*/target/*' -print0 \ - # | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - # - # Note: we compute the hash in a shell step instead of using the built-in - # hashFiles() expression because hashFiles() fails on this self-hosted - # CodeBuild runner due to a workspace-path resolution issue. - - name: Compute pom.xml hash - id: pom-hash - run: echo "hash=$(sha256sum pom.xml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - + - name: Cache Maven packages id: cache-maven uses: actions/cache@v4 with: path: /root/.m2/repository - key: ${{ runner.os }}-maven-${{ steps.pom-hash.outputs.hash }}-${{ env.SNAPSHOT }} + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.SNAPSHOT }} restore-keys: | - ${{ runner.os }}-maven-${{ steps.pom-hash.outputs.hash }}- + ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}- ${{ runner.os }}-maven- - name: Maven Install diff --git a/.github/workflows/unit-test.yml.disabled b/.github/workflows/unit-test.yml.disabled new file mode 100644 index 0000000..b54c8c1 --- /dev/null +++ b/.github/workflows/unit-test.yml.disabled @@ -0,0 +1,73 @@ +# ----------------------------------------------------------------------------- +# DISABLED WORKFLOW (kept for reference) +# +# This is the default unit-test workflow intended to run on GitHub-hosted +# `ubuntu-latest` runners. It has been disabled by renaming the file to end in +# `.yml.disabled` so GitHub Actions will not discover or execute it. The active +# workflow used by this repo is `unit-test.yml`, which targets the SEMOSS +# self-hosted CodeBuild runner (`codebuild-semoss-github-runner-...`). +# +# To restore this default workflow (e.g., if migrating back to GitHub-hosted +# runners), rename this file back to `unit-test-default.yml` and remove or +# rename the self-hosted variant. +# ----------------------------------------------------------------------------- + +name: Run Unit Tests + +on: + pull_request: + workflow_dispatch: + inputs: + snapshot: + description: 'CI version snapshot' + required: true + default: '5.3.0-SNAPSHOT' + type: choice + options: + - '5.3.0-SNAPSHOT' + # Add other snapshot versions as needed here! + clean_install: + description: 'Run `mvn clean install -U` to force-update dependencies' + required: true + default: false + type: boolean + +jobs: + test: + name: Run Test Suite + runs-on: ubuntu-latest + container: maven:3.9.9-amazoncorretto-21-debian + env: + SNAPSHOT: ${{ inputs.snapshot || '5.3.0-SNAPSHOT' }} + CLEAN_INSTALL: ${{ inputs.clean_install || 'false' }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache Maven packages + id: cache-maven + uses: actions/cache@v4 + with: + path: /root/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.SNAPSHOT }} + restore-keys: | + ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}- + ${{ runner.os }}-maven- + + - name: Maven Install + if: steps.cache-maven.outputs.cache-hit != 'true' || env.CLEAN_INSTALL == 'true' + run: | + echo "Clean install: ${CLEAN_INSTALL}" + echo "Version snapshot: ${SNAPSHOT}" + if [ "${CLEAN_INSTALL}" = "true" ]; then + echo "Running mvn clean install with -U flag" + mvn -B clean install -U -DskipTests=true -Dci.version="${SNAPSHOT}" + else + echo "Running mvn install without -U flag" + mvn -B install -DskipTests=true -Dci.version="${SNAPSHOT}" + fi + + - name: Run Unit Tests + run: mvn -B ${{ steps.cache-maven.outputs.cache-hit == 'true' && '-o' || '' }} test -Dci.version="${SNAPSHOT}" + \ No newline at end of file From d8428450cf347ae90f5525c6c453d077c5e2c2d8 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 14:35:48 -0400 Subject: [PATCH 09/12] chore: move into folder --- .github/workflows/{ => disabled}/pre-commit.yml.disabled | 0 .github/workflows/{ => disabled}/unit-test.yml.disabled | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ => disabled}/pre-commit.yml.disabled (100%) rename .github/workflows/{ => disabled}/unit-test.yml.disabled (100%) diff --git a/.github/workflows/pre-commit.yml.disabled b/.github/workflows/disabled/pre-commit.yml.disabled similarity index 100% rename from .github/workflows/pre-commit.yml.disabled rename to .github/workflows/disabled/pre-commit.yml.disabled diff --git a/.github/workflows/unit-test.yml.disabled b/.github/workflows/disabled/unit-test.yml.disabled similarity index 100% rename from .github/workflows/unit-test.yml.disabled rename to .github/workflows/disabled/unit-test.yml.disabled From 93b4d5a2f2f8bd2ded373edf0d963580a6ae0d79 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 14:39:13 -0400 Subject: [PATCH 10/12] Revert "docs: docs" This reverts commit 7026176720da18c937a5de14308748e40855e409 but maintains the disabled tests in the disabled folder --- .github/workflows/pre-commit.yml | 65 ++++++++++++++++++++++++-------- .github/workflows/unit-test.yml | 24 +++++++++--- 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 43d5e2d..0c16d40 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,20 +6,23 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} + container: public.ecr.aws/docker/library/python:3.12-bookworm steps: - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '24' - - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10 - + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'pnpm' + cache-dependency-path: 'client/pnpm-lock.yaml' + - name: Install dependencies and run frontend linting run: | if [ -d "client" ]; then @@ -28,13 +31,45 @@ jobs: else echo "No client directory found, skipping frontend linting" fi - - - name: Set up Python - uses: actions/setup-python@v4 + + # Python 3.12 is provided by the container + - name: Compute cache keys + id: keys + run: | + echo "pre-commit=$(sha256sum .pre-commit-config.yaml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + + - name: Cache pre-commit hook environments + uses: actions/cache@v4 with: - python-version: '3.12.9' - - # Official pre-commit action handles caching automatically - - uses: pre-commit/action@v3.0.1 + path: ~/.cache/pre-commit + key: pre-commit-py3.12-${{ steps.keys.outputs.pre-commit }} + restore-keys: | + pre-commit-py3.12- + + - name: Cache uv downloads + uses: actions/cache@v4 with: - extra_args: --all-files --show-diff-on-failure + path: | + ~/.cache/uv + ~/.local/share/uv + key: uv-py3.12-${{ runner.os }} + restore-keys: | + uv-py3.12- + + - name: Install OpenJDK 17 headless (required by pretty-format-java hook) + run: | + apt-get update + apt-get install -y --no-install-recommends openjdk-17-jre-headless + java -version + + - name: Install uv + run: | + if ! command -v uv >/dev/null 2>&1; then + curl -LsSf https://astral.sh/uv/install.sh | sh + fi + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + + - name: Run pre-commit + run: | + uv tool install pre-commit + uv tool run pre-commit run --all-files --show-diff-on-failure diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index f1f7a3b..62646a4 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -21,8 +21,8 @@ on: jobs: test: name: Run Test Suite - runs-on: ubuntu-latest - container: maven:3.9.9-amazoncorretto-21-debian + runs-on: codebuild-semoss-github-runner-${{ github.run_id }}-${{ github.run_attempt }} + container: public.ecr.aws/docker/library/maven:3.9.9-amazoncorretto-21-debian env: SNAPSHOT: ${{ inputs.snapshot || '5.3.0-SNAPSHOT' }} CLEAN_INSTALL: ${{ inputs.clean_install || 'false' }} @@ -30,15 +30,29 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - + + # Computes a cache key from the root pom.xml. This project is a single-module + # Maven project, so hashing the root pom.xml alone is sufficient. + # + # For a multi-module Maven project, hash every pom.xml in the tree instead: + # run: echo "hash=$(find . -name pom.xml -not -path '*/target/*' -print0 \ + # | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + # + # Note: we compute the hash in a shell step instead of using the built-in + # hashFiles() expression because hashFiles() fails on this self-hosted + # CodeBuild runner due to a workspace-path resolution issue. + - name: Compute pom.xml hash + id: pom-hash + run: echo "hash=$(sha256sum pom.xml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + - name: Cache Maven packages id: cache-maven uses: actions/cache@v4 with: path: /root/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.SNAPSHOT }} + key: ${{ runner.os }}-maven-${{ steps.pom-hash.outputs.hash }}-${{ env.SNAPSHOT }} restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}- + ${{ runner.os }}-maven-${{ steps.pom-hash.outputs.hash }}- ${{ runner.os }}-maven- - name: Maven Install From 129bafee9c3f1c49169f0953ff8550f0c4fada56 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 14:47:46 -0400 Subject: [PATCH 11/12] chore: rename --- .github/workflows/{disabled => .disabled}/pre-commit.yml.disabled | 0 .github/workflows/{disabled => .disabled}/unit-test.yml.disabled | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{disabled => .disabled}/pre-commit.yml.disabled (100%) rename .github/workflows/{disabled => .disabled}/unit-test.yml.disabled (100%) diff --git a/.github/workflows/disabled/pre-commit.yml.disabled b/.github/workflows/.disabled/pre-commit.yml.disabled similarity index 100% rename from .github/workflows/disabled/pre-commit.yml.disabled rename to .github/workflows/.disabled/pre-commit.yml.disabled diff --git a/.github/workflows/disabled/unit-test.yml.disabled b/.github/workflows/.disabled/unit-test.yml.disabled similarity index 100% rename from .github/workflows/disabled/unit-test.yml.disabled rename to .github/workflows/.disabled/unit-test.yml.disabled From 486189944d5f02b6ca5ba488419ba0aee7ccc4b1 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Fri, 17 Apr 2026 14:57:02 -0400 Subject: [PATCH 12/12] ci: try caching jdk --- .github/workflows/pre-commit.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 0c16d40..18f7d0e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -56,10 +56,23 @@ jobs: restore-keys: | uv-py3.12- + - name: Cache OpenJDK 17 + id: cache-jdk + uses: actions/cache@v4 + with: + path: /usr/lib/jvm/java-17-openjdk-amd64 + key: jdk-17-bookworm-${{ runner.os }} + - name: Install OpenJDK 17 headless (required by pretty-format-java hook) + if: steps.cache-jdk.outputs.cache-hit != 'true' run: | apt-get update apt-get install -y --no-install-recommends openjdk-17-jre-headless + + - name: Set up Java environment + run: | + echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64" >> "$GITHUB_ENV" + echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> "$GITHUB_PATH" java -version - name: Install uv