Skip to content

Commit c5c1a0d

Browse files
authored
Merge pull request #5091 from reinhapa/backport-build
[6.x.x] Backport build scripts
2 parents 672fcf3 + 9ed64ee commit c5c1a0d

File tree

11 files changed

+340
-86
lines changed

11 files changed

+340
-86
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: 'install-mvnd'
2+
description: 'Install the Maven Daemon'
3+
inputs:
4+
version:
5+
description: 'The version of the Maven Daemon to install'
6+
required: true
7+
default: '0.9.0'
8+
file-version-suffix:
9+
description: 'A suffix to append to the version of the download file of Maven Daemon to install'
10+
required: false
11+
default: ''
12+
install-path:
13+
description: 'The folder in which Maven Daemon will be installed as a sub-folder'
14+
required: true
15+
default: '/tmp'
16+
cache:
17+
description: 'Set to true to cache Maven Daemon artifacts per-platform-architecture'
18+
required: true
19+
default: 'true'
20+
mvnd-connect-timeout:
21+
description: 'The timeout (as a duration, e.g. `90 seconds`) for connecting to the Maven Daemon'
22+
required: true
23+
default: '90 seconds'
24+
outputs:
25+
mvnd-dir:
26+
description: "The directory where the command mvnd is located"
27+
value: ${{ steps.mvnd-location.outputs.mvnd-dir }}
28+
runs:
29+
using: "composite"
30+
steps:
31+
- name: Determine mvnd platform and architecture
32+
shell: bash
33+
run: |
34+
if [ "$RUNNER_OS" == "Linux" ]; then
35+
MVND_PLATFORM="linux"
36+
elif [ "$RUNNER_OS" == "macOS" ]; then
37+
MVND_PLATFORM="darwin"
38+
elif [ "$RUNNER_OS" == "Windows" ]; then
39+
MVND_PLATFORM="windows"
40+
else
41+
"echo Unknown platform: $RUNNER_OS"
42+
exit 1
43+
fi
44+
MVND_ARCHITECTURE="amd64"
45+
echo "MVND_PLATFORM=${MVND_PLATFORM}" >> $GITHUB_ENV
46+
echo "MVND_ARCHITECTURE=${MVND_ARCHITECTURE}" >> $GITHUB_ENV
47+
echo "MVND_NAME=maven-mvnd-${{ inputs.version }}${{ inputs.file-version-suffix }}-${MVND_PLATFORM}-${MVND_ARCHITECTURE}" >> $GITHUB_ENV
48+
- name: Cache mvnd
49+
if: inputs.cache == 'true'
50+
id: cache-mvnd
51+
uses: actions/cache@v3
52+
with:
53+
path: |
54+
${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip
55+
${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip.sha256
56+
${{ inputs.install-path }}/${{ env.MVND_NAME }}
57+
key: setup-${{ env.MVND_NAME }}
58+
- name: Download mvnd
59+
if: steps.cache-mvnd.outputs.cache-hit != 'true'
60+
shell: bash
61+
run: |
62+
curl -fsSL -o ${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/${{ env.MVND_NAME }}.zip
63+
curl -fsSL -o ${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip.sha256 https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/${{ env.MVND_NAME }}.zip.sha256
64+
- name: Install sha256sum (macOS)
65+
if: ${{ runner.os == 'macOS' }}
66+
shell: bash
67+
run: brew install coreutils
68+
- name: Verify mvnd sha256 checksum
69+
shell: bash
70+
run: echo "$(cat ${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip.sha256) ${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip" | sha256sum --check
71+
- name: Unzip mvnd
72+
if: steps.cache-mvnd.outputs.cache-hit != 'true'
73+
shell: bash
74+
run: unzip ${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip -d ${{ inputs.install-path }}/
75+
- name: Show Maven Daemon version
76+
shell: bash
77+
run: |
78+
${{ inputs.install-path }}/${{ env.MVND_NAME }}/bin/mvnd -D'mvnd.connectTimeout=${{ inputs.mvnd-connect-timeout }}' --version
79+
${{ inputs.install-path }}/${{ env.MVND_NAME }}/bin/mvnd -D'mvnd.connectTimeout=${{ inputs.mvnd-connect-timeout }}' --status
80+
- name: Set mvnd-dir
81+
id: mvnd-location
82+
shell: bash
83+
run: |
84+
MVND_BIN_DIR="${{ inputs.install-path }}/${{ env.MVND_NAME }}/bin"
85+
if [ "$RUNNER_OS" == "Windows" ]; then
86+
MVND_BIN_DIR="$(cygpath --absolute --long-name --windows $MVND_BIN_DIR)"
87+
fi
88+
echo "MVND_BIN_DIR=${MVND_BIN_DIR}" >> $GITHUB_ENV
89+
echo "mvnd-dir=${MVND_BIN_DIR}" >> $GITHUB_OUTPUT

.github/dependabot.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
version: 2
22
updates:
3-
- package-ecosystem: maven
3+
4+
- package-ecosystem: "github-actions"
5+
target-branch: "develop-6.x.x"
46
directory: "/"
57
schedule:
6-
interval: daily
8+
interval: "weekly"
9+
- package-ecosystem: "maven"
10+
target-branch: "develop-6.x.x"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"
714
time: "03:00"
815
open-pull-requests-limit: 10
916
ignore:
@@ -36,23 +43,23 @@ updates:
3643
- "> 1.9.4, < 1.10"
3744
- dependency-name: net.sf.saxon:Saxon-HE
3845
versions:
39-
> "9"
46+
- "> 9"
4047
- dependency-name: org.hsqldb:hsqldb
4148
versions:
42-
- 2.6.0
49+
- "2.6.0"
4350
- dependency-name: com.ibm.icu:icu4j
4451
versions:
4552
- "69.1"
4653
- dependency-name: com.sun.mail:jakarta.mail
4754
versions:
48-
- 2.0.1
55+
- "2.0.1"
4956
- dependency-name: com.sun.activation:jakarta.activation
5057
versions:
51-
- 2.0.1
58+
- "2.0.1"
5259
- dependency-name: com.mycila:license-maven-plugin
5360
versions:
5461
- "4.0"
55-
- 4.0.rc2
62+
- "4.0.rc2"
5663
- dependency-name: org.owasp:dependency-check-maven
5764
versions:
58-
- 6.1.3
65+
- "6.1.3"

.github/workflows/ci-deploy.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ jobs:
77
# NOTE (DP): Publish on develop and master, test on PRs against these
88
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.base_ref == 'develop' || github.base_ref == 'master'
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
with:
1212
fetch-depth: 1
1313
- name: Set up JDK 8
14-
uses: actions/setup-java@v2
14+
uses: actions/setup-java@v3
1515
with:
1616
distribution: temurin
1717
java-version: '8'
1818
- name: Make buildkit default
19-
uses: docker/setup-buildx-action@v1
19+
uses: docker/setup-buildx-action@v3
2020
id: buildx
2121
with:
2222
install: true
2323
- name: Cache Maven packages
24-
uses: actions/cache@v2
24+
uses: actions/cache@v3
2525
with:
2626
path: ~/.m2
27-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
28-
restore-keys: ${{ runner.os }}-m2
27+
key: deploy-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28+
restore-keys: deploy-${{ runner.os }}-maven
2929
- name: Install bats
3030
run: sudo apt-get install bats
3131
- name: Build images
32-
run: mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true clean package
32+
run: mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean package
3333
- name: Check local images
3434
run: docker image ls
3535
- name: Check license headers
@@ -66,6 +66,6 @@ jobs:
6666
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
6868
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
69-
# run: mvn -Ddocker.tag=experimental -Ddocker.username=$DOCKER_USERNAME -Ddocker.password=$DOCKER_PASSWORD docker:build docker:push
69+
# run: mvn -q -Ddocker.tag=experimental -Ddocker.username=$DOCKER_USERNAME -Ddocker.password=$DOCKER_PASSWORD docker:build docker:push
7070
# working-directory: ./exist-docker
7171

.github/workflows/ci-docs.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/ci-test.yml

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,80 @@
1-
name: Test
1+
name: Test & documentation
22
on: [push, pull_request]
3+
permissions:
4+
contents: read
5+
env:
6+
MAVEN_OPTS: -XX:StartFlightRecording=maxsize=5g,disk=true,dumponexit=true,settings=default,filename=./ -DtrimStackTrace=false -D'maven.resolver.transport=wagon'
7+
DEV_JDK: '8'
38
jobs:
9+
license:
10+
name: License check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: temurin
17+
java-version: ${{ env.DEV_JDK }}
18+
cache: 'maven'
19+
- run: mvn -V -B license:check
20+
timeout-minutes: 60
21+
dependencies:
22+
name: Dependency checks
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-java@v3
27+
with:
28+
distribution: temurin
29+
java-version: ${{ env.DEV_JDK }}
30+
cache: 'maven'
31+
- run: mvn -V -B dependency-check:check
32+
timeout-minutes: 60
433
test:
5-
name: (JDK ${{ matrix.jdk }} / ${{ matrix.os }}) Test
6-
env:
7-
MAVEN_OPTS: -XX:+IgnoreUnrecognizedVMOptions --illegal-access=debug -XX:StartFlightRecording=maxsize=5g,disk=true,dumponexit=true,settings=default,filename=./
34+
name: ${{ matrix.os }} Test
835
strategy:
936
fail-fast: false
1037
matrix:
1138
os: [ubuntu-latest, windows-latest, macOS-latest]
12-
jdk: ['8', '11']
13-
include:
14-
- os: ubuntu-latest
15-
jdk: '16'
1639
runs-on: ${{ matrix.os }}
1740
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up JDK ${{ matrix.jdk }}
20-
uses: actions/setup-java@v2
41+
- uses: actions/checkout@v4
42+
- name: Set up JDK
43+
uses: actions/setup-java@v3
2144
with:
2245
distribution: temurin
23-
java-version: ${{ matrix.jdk }}
46+
java-version: ${{ env.DEV_JDK }}
2447
cache: 'maven'
48+
- name: Install Maven Daemon
49+
id: install-mvnd
50+
uses: ./.github/actions/install-mvnd
51+
with:
52+
version: '1.0-m7'
53+
file-version-suffix: '-m39'
54+
cache: 'true'
55+
- name: Maven Build
56+
timeout-minutes: 10
57+
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B -T 1C compile test-compile -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip'
2558
- name: Maven Test
2659
timeout-minutes: 60
27-
run: mvn -V -B -DtrimStackTrace=false clean verify
28-
continue-on-error: ${{ matrix.jdk == '16' }}
29-
- name: Maven Code Coverage
30-
if: ${{ github.ref == 'refs/heads/develop' && matrix.jdk == '8' && matrix.os == 'ubuntu-latest' }}
60+
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B verify -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' -D'mvnd.maxLostKeepAlive=6000'
61+
- name: Javadoc (Linux only)
62+
if: ${{ matrix.os == 'ubuntu-latest' }}
63+
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B -q -T 1C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make
64+
- name: Maven Code Coverage (Develop branch on Linux only)
65+
if: ${{ github.ref == 'refs/heads/develop' && matrix.os == 'ubuntu-latest' }}
3166
env:
3267
CI_NAME: github
3368
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
3469
CI_BUILD_NUMBER: ${{ github.run_id }}
3570
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
3671
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
37-
run: mvn -V -B jacoco:report coveralls:report
72+
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B jacoco:report coveralls:report
3873
- name: Archive build logs
3974
if: always()
40-
uses: actions/upload-artifact@v2
75+
uses: actions/upload-artifact@v3
4176
with:
42-
name: ${{ runner.os }}-jdk${{ matrix.jdk }}-build-logs
77+
name: ${{ runner.os }}-build-logs
4378
retention-days: 5
4479
path: |
4580
**/*.jfr

.github/workflows/ci-xqts.yml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,58 @@ jobs:
88
name: W3C XQuery Test Suite
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- name: Set up JDK 8
13-
uses: actions/setup-java@v2
13+
uses: actions/setup-java@v3
1414
with:
1515
distribution: temurin
1616
java-version: '8'
17-
cache: 'maven'
17+
- name: Cache Maven packages
18+
uses: actions/cache@v3
19+
with:
20+
path: ~/.m2
21+
key: xqts-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22+
restore-keys: xqts-${{ runner.os }}-maven
1823
- name: Maven XQTS Build
1924
run: mvn -V -B clean package -DskipTests -Ddependency-check.skip=true --projects exist-xqts --also-make
2025
- name: Run XQTS
2126
timeout-minutes: 60
2227
env:
23-
JAVA_OPTS: -XX:+UseG1GC -XX:+UseStringDeduplication
24-
run: find exist-xqts/target -name exist-xqts-runner.sh -exec {} --xqts-version HEAD --output-dir /tmp/xqts-output \;
28+
JAVA_OPTS: -XX:+UseG1GC -XX:+UseStringDeduplication -Xmx6g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -XX:+ExitOnOutOfMemoryError
29+
run: find exist-xqts/target -name exist-xqts-runner.sh -exec {} --xqts-version HEAD --output-dir /tmp/xqts-output --exclude-test-case RangeExpr-411d,RangeExpr-409d,RangeExpr-408d,RangeExpr-409c,RangeExpr-408c,GenCompEq-21 \;
30+
- name: Check for HeapDump
31+
id: check_heapdump
32+
uses: andstor/file-existence-action@v2
33+
with:
34+
files: "/tmp/*.hprof"
35+
- name: Compress HeapDump
36+
if: steps.check_heapdump.outputs.files_exists == 'true'
37+
run: zstd --rm -9 --progress -T0 /tmp/*.hprof
38+
- name: Attach HeapDump artifact
39+
if: steps.check_heapdump.outputs.files_exists == 'true'
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: exist-xqts-runner-hprof
43+
retention-days: 1
44+
path: /tmp/*.hprof.zst
2545
- name: Archive XQTS Logs
2646
if: always()
27-
uses: actions/upload-artifact@v2
47+
uses: actions/upload-artifact@v3
2848
with:
2949
name: xqts-logs
3050
retention-days: 14
3151
path: /tmp/xqts-output
52+
- name: Get Previous XQTS Logs Artifacts JSON
53+
run: 'curl -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/exist-db/exist/actions/artifacts?name=xqts-logs > /tmp/previous-xqts-logs-artifacts.json'
54+
- name: Extract Previous XQTS Logs Artifact JSON
55+
run: cat /tmp/previous-xqts-logs-artifacts.json | jq -r "[.artifacts[] | select(.workflow_run.head_branch == \"develop\")][1].archive_download_url" > /tmp/previous-xqts-logs-artifact.json
56+
- name: Get Previous XQTS Logs Artifact
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
run: 'cat /tmp/previous-xqts-logs-artifact.json | xargs curl -H "Authorization: Bearer ${GITHUB_TOKEN}" --location --output /tmp/previous-xqts-output.zip'
60+
- name: Extract Previous XQTS Logs Artifact
61+
run: mkdir /tmp/previous-xqts-output && unzip /tmp/previous-xqts-output.zip -d /tmp/previous-xqts-output
62+
- name: Compare Previous and Current XQTS Logs
63+
run: java -jar ~/.m2/repository/net/sf/saxon/Saxon-HE/9.9.1-8/Saxon-HE-9.9.1-8.jar -xsl:exist-xqts/src/main/xslt/compare-results.xslt -it:compare-results -o:/tmp/comparison-results.xml xqts.previous.junit-data-path=/tmp/previous-xqts-output/junit/data xqts.current.junit-data-path=/tmp/xqts-output/junit/data
64+
- name: Show Comparison Results
65+
run: cat /tmp/comparison-results.xml

0 commit comments

Comments
 (0)