-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust CI for docker use
- Loading branch information
Showing
11 changed files
with
14,891 additions
and
7,359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: "chore(gha):" | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "03:00" | ||
commit-message: | ||
prefix: "chore(npm):" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# This workflow builds a xar archive, deploys it into exist and execute a simple smoke test. | ||
# 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 | ||
# For node free automated release see https://trstringer.com/github-actions-create-release-upload-artifacts/ | ||
|
||
name: exist-db CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# 7.0.0-SNAPSHOT and 6.2.1 created | ||
exist-version: [latest, release] | ||
java-version: [11, 17] | ||
exclude: | ||
- exist-version: release | ||
java-version: 17 | ||
- exist-version: latest | ||
java-version: 11 | ||
|
||
steps: | ||
# Checkout code | ||
- uses: actions/checkout@v4 | ||
- name: Install Test Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libxml2-utils bats | ||
# sanity check | ||
# TODO(DP) Validate ? | ||
- name: Ensure all XML files are well-formed | ||
run: | | ||
xmllint --noout \ | ||
$(find . -type f -name '*.xml') | ||
# Build | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
node-version: lts/* | ||
|
||
- name: Build Expath Package | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: ${{ matrix.java-version }} | ||
- run: -Dapp.version=1.0.0-SNAPSHOT | ||
|
||
- name: Add expath dependencies | ||
working-directory: build | ||
run: | | ||
wget https://exist-db.org/exist/apps/public-repo/public/expath-crypto-module-6.0.1.xar -O 000.xar | ||
wget http://exist-db.org/exist/apps/public-repo/public/templating-1.1.0.xar -O 001.xar | ||
wget https://exist-db.org/exist/apps/public-repo/public/tei-publisher-lib-2.10.1.xar -O 002.xar | ||
wget https://exist-db.org/exist/apps/public-repo/public/functx-1.0.1.xar -O 003.xar | ||
# Install | ||
- name: Start exist-ci containers | ||
run: | | ||
docker run -dit -p 8080:8080 -v ${{ github.workspace }}/build:/exist/autodeploy \ | ||
--name exist --rm --health-interval=2s --health-start-period=4s \ | ||
duncdrum/existdb:${{ matrix.exist-version }} | ||
- name: wait for install to finish | ||
timeout-minutes: 10 | ||
run: | | ||
while ! docker logs exist | grep -q "Server has started"; \ | ||
do sleep 2s; \ | ||
done | ||
# Test | ||
- name: Run smoke test | ||
run: bats --tap tests/bats/*.bats | ||
|
||
# TODO: add further tests | ||
|
||
# Lint commit messages | ||
- name: lint commit message | ||
uses: wagoid/commitlint-github-action@v5 | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
node-version: lts/* | ||
- name: Install dependencies | ||
run: npm ci --no-optional | ||
- name: Perform Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PUBLIC_REPO: ${{ secrets.PUBLIC_REPO }} | ||
run: npx semantic-release | ||
# TODO(DP): | ||
# - add secrets to github | ||
# - publish to public repo? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,5 @@ build.properties.local.xml | |
!.npmrc | ||
!.nvmrc | ||
!.gitkeep | ||
!.github/ | ||
!.releaserc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits" | ||
}, | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits" | ||
}, | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "ant -Dapp.version=${nextRelease.version}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"package.json", | ||
"package-lock.json" | ||
], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [ | ||
{ | ||
"path": "build/hsg-shell.xar", | ||
"name": "hsg-shell.xar", | ||
"label": "Expath package (hsg-shell.xar)" | ||
} | ||
] | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'body-max-line-length': [1, 'always', 200] | ||
} | ||
} |
Oops, something went wrong.