From 89dc05200f6bbbdb6520f4b560ab9b9854837d32 Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Sat, 12 Oct 2024 11:34:58 -0300 Subject: [PATCH] Test uploading jar files and downloading to build the images wihout re-packaging --- .github/workflows/pull-request.yaml | 27 +++++++++++++++++++++++---- Makefile | 10 +++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 09002f0cd..5a1406717 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -38,12 +38,21 @@ jobs: cache: 'maven' - name: Validate source code formatting - run: make lint + run: | + make lint - name: Test run: | - #make test - echo "skipping to test the acceptance job" + # `make test` runs mvn verify, which includes mvn package, so no need to run `package` separatedly for the upload step below + make test + + - name: Upload application jar files + uses: actions/upload-artifact@v4 + with: + name: application-jars + path: ./**/target/*-bin.jar + retention-days: 1 + compression-level: 0 # no compression acceptance: name: Acceptance Tests @@ -67,9 +76,19 @@ jobs: java-version: '21' cache: 'maven' + - name: Download application jar files + uses: actions/download-artifact@v4 + with: + name: application-jars + path: . + + - name: Copy config directory + # during the validate phase, the config/ dir is copied to each app's target/config + run: ./mvnw validate -ntp -T1C + - name: Build images # REPACKAGE=false avoids to re-package the apps during build-image - run: REPACKAGE=false make package build-image + run: REPACKAGE=false make build-image - name: Install CI dependencies run: python3 -m pip install --user --requirement=ci/requirements.txt diff --git a/Makefile b/Makefile index 79206b6db..19c6312f4 100644 --- a/Makefile +++ b/Makefile @@ -13,23 +13,23 @@ clean: .PHONY: lint lint: - ./mvnw fmt:check sortpom:verify -Dsort.verifyFailOn=strict -Dsort.verifyFail=stop -ntp + ./mvnw fmt:check sortpom:verify -Dsort.verifyFailOn=strict -Dsort.verifyFail=stop -ntp -T1C .PHONY: format format: - ./mvnw sortpom:sort fmt:format -ntp + ./mvnw sortpom:sort fmt:format -ntp -T1C .PHONY: install install: - ./mvnw clean install -DskipTests -ntp -T4 -U + ./mvnw clean install -DskipTests -ntp -U -T1C .PHONY: package package: - ./mvnw clean package -DskipTests -ntp -T4 -U + ./mvnw clean package -DskipTests -ntp -U -T1C .PHONY: test test: - ./mvnw verify -ntp -T4 + ./mvnw verify -ntp -T1C .PHONY: build-image build-image: build-base-images build-image-infrastructure build-image-geoserver