From b951ed269afc12ab283537ed6a6d93f14602d6f7 Mon Sep 17 00:00:00 2001 From: evanchooly Date: Tue, 6 Oct 2026 00:01:38 -0400 Subject: [PATCH] Test critter's pre-generated models in pull-request CI The pull-request workflow's build runs a plain install, so critter has no pre-generated models there and every model is generated at runtime. Pushes to this repo also run build.yml, which tests against generated models, but pull requests from forks only get this workflow. Add a job that builds, runs critter-maven's generate-test-models and then runs the tests without recompiling, as build.yml does. --- .github/workflows/pull-request.yml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c2491f461ad..72bff8c6043 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,3 +13,42 @@ jobs: with: java: 17 maven-flags: "-e -Dmorphia.mapper=critter" + + # The Build job above runs a plain `install`, so critter has no pre-generated models and generates every model at + # runtime. This job covers the AOT path the way build.yml does: build, let critter-maven generate the test models, + # then run the tests without recompiling (test-compile would replace the woven classes). Pushes to this repo also run + # build.yml, but pull requests from forks only get this workflow. + CritterAot: + name: Critter (AOT) + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Setup Java + uses: actions/setup-java@v5 + with: + java-version: 17 + distribution: temurin + cache: maven + + - name: Build without tests + run: ./mvnw -e -U install -DskipTests + + - name: Generate critter test models + working-directory: core + run: ../mvnw -e dev.morphia.morphia:critter-maven:generate-test-models + + - name: Test against the generated models + run: ./mvnw -e surefire:test -Dmorphia.mapper=critter + + - name: Collect logs + uses: actions/upload-artifact@v6 + if: failure() + with: + name: "logs-critter-aot-${{ github.run_id }}" + path: | + **/target/**/*.log + **/target/**/*.err + retention-days: 7