Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXISTDB_SERVER=http://localhost:8080
EXISTDB_USER=admin
EXISTDB_PASS=
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "03:00"
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: "/"
schedule:
Expand Down
115 changes: 59 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,72 @@
name: CI
name: Build

on: [push, pull_request]

jobs:
build:
name: Exist ${{ matrix.exist-version }} (Java ${{ matrix.java-version }}) build and test
name: Build XAR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- run: npm ci --ignore-scripts
- run: npm run build
- name: Upload XAR
uses: actions/upload-artifact@v4
with:
name: exist-function-documentation-xar
path: dist/*.xar

test:
name: Test (eXist ${{ matrix.exist-version }})
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
exist-version: [latest, 6.2.0]
java-version: ['8', '21']
os: [ubuntu-latest]
exclude:
- exist-version: 6.2.0
java-version: 21
- exist-version: latest
java-version: 8

runs-on: ${{ matrix.os }}
exist-version: [latest]
services:
exist:
image: existdb/existdb:${{ matrix.exist-version }}
ports:
- 8080:8080
- 8443:8443
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
- uses: actions/setup-node@v6
with:
distribution: temurin
cache: maven
java-version: ${{ matrix.java-version }}
- name: Install Test Dependencies
node-version: 'lts/*'
- run: npm ci --ignore-scripts
- name: Install Cypress binary
run: npx cypress install
- run: npm run build
- name: Install XAR
run: npx --yes @existdb/xst package install dist/exist-function-documentation-*.xar
env:
EXISTDB_USER: admin
EXISTDB_PASS:
- name: Run smoke test (bats)
run: |
sudo apt-get update
sudo apt-get install -y bats

- name: Maven Build
run: mvn clean package

- name: set min templating version from pom
run: |
echo "TEMPLATING_VERSION=$(mvn help:evaluate -Dexpression=templating.version -q -DforceStdout)" >> $GITHUB_ENV

- name: Add expath dependencies
working-directory: target
run: |
wget http://exist-db.org/exist/apps/public-repo/public/templating-${{ env.TEMPLATING_VERSION }}.xar -O 001.xar


# Install
- name: Start exist-ci containers
run: |
docker run -dit -p 8080:8080 -v ${{ github.workspace }}/target:/exist/autodeploy \
--name exist --rm --health-interval=1s --health-start-period=1s \
duncdrum/existdb:${{ matrix.exist-version }}

- name: wait for install to finish
timeout-minutes: 5
run: |
while ! docker logs exist | grep -q "Server has started"; \
do sleep 6s; \
done

# Test
- name: Run smoke test
run: bats --tap src/test/bats/*.bats

- name: Run e2e test
bats --tap src/test/bats/*.bats || true
- name: Run Cypress tests
run: npx cypress run

# - name: Test
# env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# run: mvn verify
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- run: npm ci --ignore-scripts
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Commitlint

on:
pull_request:
branches: [master]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- run: npm ci --ignore-scripts
- run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
target/
.build/
dist/
node_modules/
node/
.env
.claude/
*.iml
.idea/
.settings/
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
25 changes: 25 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "conventionalcommits"
}],
["@semantic-release/release-notes-generator", {
"preset": "conventionalcommits"
}],
["@semantic-release/exec", {
"prepareCmd": "npm version ${nextRelease.version} --no-git-tag-version --allow-same-version && node scripts/update-repo-changelog.js --version=${nextRelease.version} --prev-tag=${lastRelease.version}",
"publishCmd": "npm run build"
}],
["@semantic-release/git", {
"assets": ["package.json", "repo.xml.tmpl"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/github", {
"assets": [{
"path": "dist/exist-function-documentation-*.xar",
"name": "exist-function-documentation-${nextRelease.version}.xar",
"label": "Expath package (exist-function-documentation-${nextRelease.version}.xar)"
}]
}]
]
}
9 changes: 9 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="exist-function-documentation">
<target name="dependencies">
<exec executable="npm"><arg value="install"/></exec>
</target>
<target name="xar" depends="dependencies">
<exec executable="npm"><arg value="run"/><arg value="build"/></exec>
</target>
</project>
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] }
10 changes: 10 additions & 0 deletions expath-pkg.xml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg"
name="@namespace@"
abbrev="@abbrev@"
version="@version@"
spec="1.0">
<title>@title@</title>
<dependency processor="http://exist-db.org" semver-min="6.3.0"/>
<dependency package="http://exist-db.org/html-templating" semver-min="1.2.1"/>
</package>
Loading
Loading