From a660aa1d27c5a56ae0458f01adb016f5078a9ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20K=C3=B6rner?= Date: Mon, 28 Oct 2024 15:01:41 +0100 Subject: [PATCH] Test generate endpoint project in CI - Add generated project building step - Fix artifact id, may not contain dots? - Dump info about environment - Show dep tree of generated project - Add -batch-mode/-ntp maven flags to shorten transfer messages --- .github/workflows/test.yml | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e436929 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,58 @@ +name: Test maven archetype project generation + +on: [ push ] + +concurrency: + group: ${{ github.workflow }}-${{ github.sha }} + cancel-in-progress: true + +jobs: + generate-endpoint-project: + runs-on: ubuntu-latest + + strategy: + matrix: + java-version: [ '11', '17', '21' ] + + steps: + - uses: actions/checkout@v4 + + - name: Use Java ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + + - name: Info (java) + run: java --version + + - name: Info (maven) + run: mvn --version + + - name: Install archetype + run: mvn --batch-mode clean install "archetype:update-local-catalog" + + - name: Create endpoint project + env: + WORKPATH: work/${{ matrix.java-version }}/ + run: | + mkdir -p "$WORKPATH" + cd "$WORKPATH" + mvn archetype:generate \ + -DarchetypeGroupId=eu.clarin.sru.fcs \ + -DarchetypeArtifactId=fcs-endpoint-archetype \ + -DarchetypeVersion=1.6.0-SNAPSHOT \ + -DarchetypeCatalog=local \ + -DgroupId=eu.clarin.sru.fcs.my \ + -DartifactId=test-endpoint \ + -Dversion=1.0-SNAPSHOT \ + -DinstitutionName="Test endpoint for Java ${{ matrix.java-version }}" \ + --batch-mode --debug + + - name: Build endpoint project + env: + WORKPATH: work/${{ matrix.java-version }}/test-endpoint/ + run: | + cd "$WORKPATH" + mvn --batch-mode clean package + mvn -ntp dependency:tree -Ddetail=true