Skip to content
Open
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 .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
24 changes: 24 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Commit lint
run-name: Linting commit messages

on:
pull_request:
types:
- opened
- synchronize

jobs:
lint:
name: Lint commit messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci --omit=optional
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Semantic Release

on:
workflow_run:
workflows: [test]
branches: [main]
types:
- completed

permissions:
contents: read

jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci --omit=optional
- run: npm run build
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88 changes: 88 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This workflow builds a xar archive, deploys it into exist and execute its test suites.
# It also includes code for using semantic-release to upload packages as part of GitHub releases
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# eXide 4.0 requires eXist 7.0+ (lang/cursor modules from existdb-openapi),
# so we test only against the 'latest' (develop) Docker tag.
exist-version: [latest]
# Node 22 is EOL; track current Node LTS (24).
node-version: ['24']

steps:
- uses: actions/checkout@v6
with:
submodules: recursive

# Install dependencies and build EXPath Package
- name: Install node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm test

- name: Validate OpenAPI schema
run: npx --yes @redocly/cli lint modules/api.json

- name: Build frontend Using node.js ${{ matrix.node-version }} and build EXPath Package
run: npm run build

- name: Download Roaster dependency
run: gh release download v1.12.0 --repo eeditiones/roaster --pattern "roaster-1.12.0.xar" --output build/roaster-1.12.0.xar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.12.1 ?

env:
GH_TOKEN: ${{ github.token }}

- name: Download existdb-openapi dependency
run: gh release download v0.9.5 --repo eXist-db/existdb-openapi --pattern "existdb-openapi-*.xar" --dir build/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.9.7 or simply latest same above for roaster

env:
GH_TOKEN: ${{ github.token }}

- name: Start eXist-db Docker Container
run: docker run --rm --name exist --volume $(pwd)/build:/exist/autodeploy:ro --publish 8080:8080 --detach existdb/existdb:${{ matrix.exist-version }}

- name: Wait for eXist-db Startup and Package Deployment
run: |
for i in $(seq 1 24); do
HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/exist/apps/eXide/index.html || true)
echo "Attempt $i: HTTP $HTTP_CODE"
if [ "$HTTP_CODE" = "200" ]; then
echo "eXide is ready"
exit 0
fi
sleep 5
done
echo "Timed out waiting for eXide"
exit 1

- name: Run Cypress Integration Tests
run: npx cypress run --spec 'cypress/e2e/*.cy.js'

- name: Upload Cypress Screenshots (on failure)
uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-${{ matrix.exist-version }}-${{ matrix.node-version }}
path: cypress/screenshots

# Test run video was always captured, so this action uses "always()" condition
- name: Upload Cypress Videos
uses: actions/upload-artifact@v7
if: always()
with:
name: cypress-videos-${{ matrix.exist-version }}-${{ matrix.node-version }}
path: cypress/videos
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
.DS_Store
.env
.*
!.gitignore
!.existdb.json
!.gitmodules
!.github
!.releaserc
!.commitlintrc.js
!.husky

build/*
expath-pkg.xml

Expand All @@ -22,9 +29,3 @@ cypress/videos/*.mp4
cypress/screenshots/**/*.png

CLAUDE.md

.*
!.gitignore
!.existdb.json
!.gitmodules
!.github
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
30 changes: 30 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/*.xar",
"name": "eXide-${nextRelease.version}.xar"
}
]
}
]
]
}
Loading
Loading