Skip to content

Commit 2912c25

Browse files
committed
ci: build the modules while the bare-metal jahia boots
1 parent 8cad555 commit 2912c25

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

‎.github/workflows/e2e-bare-metal.yml‎

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,13 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
jobs:
23-
build:
24-
name: Build Module
25-
runs-on: ubuntu-latest
26-
env:
27-
NEXUS_INTERNAL_URL: ${{ secrets.NEXUS_INTERNAL_URL }}
28-
container:
29-
image: ghcr.io/jahia/jahia-docker-mvn-cache:17-jdk-noble-mvn-loaded
30-
credentials:
31-
username: ${{ secrets.GH_PACKAGES_USERNAME }}
32-
password: ${{ secrets.GH_PACKAGES_TOKEN }}
33-
steps:
34-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35-
- uses: jahia/jahia-modules-action/build@v2
36-
with:
37-
mvn_settings_filepath: ".github/maven.settings.xml"
38-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
39-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
40-
23+
# The modules build in this job, while Jahia boots: see tests/ci.build.bare-metal.sh
4124
integration-tests:
4225
name: Integration Tests (bare metal)
43-
needs: build
4426
runs-on: ubuntu-26.04
4527
timeout-minutes: 65
28+
env:
29+
NEXUS_INTERNAL_URL: ${{ secrets.NEXUS_INTERNAL_URL }}
4630
steps:
4731
# The runner ships the Compose plugin only, the action still calls the docker-compose binary to export the logs
4832
- name: Expose docker compose as docker-compose
@@ -62,7 +46,14 @@ jobs:
6246
path: |
6347
~/.cache/Cypress
6448
~/.yarn/berry/cache
65-
key: e2e-bare-metal-${{ runner.os }}-${{ hashFiles('tests/yarn.lock') }}
49+
key: e2e-bare-metal-${{ runner.os }}-${{ hashFiles('yarn.lock', 'tests/yarn.lock') }}
50+
51+
- name: Cache the Maven repository
52+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
53+
with:
54+
path: ~/.m2/repository
55+
key: e2e-bare-metal-maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
56+
restore-keys: e2e-bare-metal-maven-${{ runner.os }}-
6657

6758
- uses: jahia/jahia-modules-action/integration-tests@v2
6859
with:

‎tests/ci.build.bare-metal.sh‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
#!/bin/bash
22
# Prepares a run where Cypress runs on the host instead of in a test image.
3-
# Jahia boots in the background while the test dependencies install.
3+
# Jahia boots while the modules build and the test dependencies install.
44
set -euo pipefail
55

66
# Provides the compose variables, SUPER_USER_PASSWORD among them
77
source ./set-env.sh
88

99
docker compose up -d --renew-anon-volumes jahia < /dev/null
1010

11+
# The build log goes to a file so it does not interleave with the yarn output
12+
JAVA_HOME="$JAVA_HOME_17_X64" mvn -B -U -ntp -f ../pom.xml -s ../.github/maven.settings.xml clean install > artifacts/mvn.log 2>&1 &
13+
mvn_pid=$!
14+
1115
CI=true yarn install --immutable
1216
yarn cypress install
17+
18+
if ! wait "$mvn_pid"; then
19+
cat artifacts/mvn.log
20+
exit 1
21+
fi
22+
grep -A 15 'Reactor Summary' artifacts/mvn.log
23+
24+
# The action collects the modules before this script runs, so the fresh build is collected here
25+
find .. -type d -name node_modules -prune -o -type f -path '*/target/*' \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT.tgz' \) -print -exec cp {} artifacts/ \;

0 commit comments

Comments
 (0)