Repository navigation
feat(odd): del #1455
This file contains hidden or 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
| # Build XAR, deploy into eXist, run smoke and Cypress tests. | |
| name: jinks | |
| concurrency: | |
| group: jinks-build-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [ '**' ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.experimental }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # 7.0.0-SNAPSHOT and 6.4.0 created | |
| exist-version: [6.4.0, release] | |
| java-version: [11] | |
| experimental: [false] | |
| include: | |
| - exist-version: latest | |
| java-version: 21 | |
| experimental: true | |
| - exist-version: release | |
| java-version: 11 | |
| experimental: true | |
| webcomponents-version: next | |
| steps: | |
| # Checkout code | |
| - uses: actions/checkout@v6 | |
| # Speed up apt-get installs | |
| - name: Disable man-db to make package install and removal faster | |
| run: | | |
| echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null | |
| sudo dpkg-reconfigure man-db | |
| - name: Install Test Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libxml2-utils bats | |
| # sanity check | |
| - name: Ensure all XML files are well-formed | |
| run: | | |
| xmllint --noout \ | |
| $(find . -type f -name '*.xml') | |
| - name: Validate ODD files | |
| working-directory: profiles/base10/resources/odd | |
| run: | | |
| errors=0 | |
| total=0 | |
| while IFS= read -r odd_file; do | |
| total=$((total + 1)) | |
| relative_path="${odd_file#../../../}" | |
| output=$(xmllint --noout --schema teipublisher_odds.xsd "$odd_file" 2>&1 | grep -v "Schemas parser warning" | grep -v "^$") | |
| exit_code=$? | |
| if [ $exit_code -eq 0 ]; then | |
| echo "✓ $relative_path" | |
| else | |
| echo "✗ $relative_path" | |
| echo "$output" | sed 's/^/ /' | |
| errors=$((errors + 1)) | |
| fi | |
| done < <(find ../../../profiles -name "*.odd" -type f) | |
| echo "Validated $total ODD file(s)" | |
| if [ $errors -gt 0 ]; then | |
| echo "Validation failed: $errors error(s) found" | |
| exit 1 | |
| fi | |
| echo "All ODD files validated successfully" | |
| # Install webcomponents version for testing (only when specified in matrix) | |
| - name: Setup Node.js | |
| if: matrix.webcomponents-version != '' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| - name: Install dependencies | |
| if: matrix.webcomponents-version != '' | |
| run: npm ci | |
| - name: Install webcomponents version | |
| if: matrix.webcomponents-version != '' | |
| run: npm install @teipublisher/pb-components@${{ matrix.webcomponents-version }} | |
| # Build | |
| - name: Install Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java-version }} | |
| - run: ant | |
| # For private repos use secret org token | |
| - name: authenticate gh cli | |
| timeout-minutes: 1 | |
| run: gh auth status | |
| - name: Add Expath Dependency | |
| working-directory: build/ | |
| run: | | |
| gh release download -R eeditiones/jinks-templates -p '*.xar' -O '_jinks-tmpl.xar' | |
| gh release download -R eeditiones/roaster -p 'roaster-*.xar' -O '_roaster.xar' v1.12.1 | |
| gh release download -R eeditiones/tei-publisher-lib -p '*.xar' -O '_tp-lib.xar' | |
| gh release download -R eXist-db/templating -p '*.xar' -O '_templating.xar' | |
| # Pinned: crypto 7.x and jwt 2.0.2 require eXist > 7.0.0-SNAPSHOT; CI matrix uses 6.4.x | |
| gh release download -R eXist-db/expath-crypto-module -p '*.xar' -O '_crypto.xar' 6.0.1 | |
| gh release download -R eXistSolutions/exist-jwt -p '*.xar' -O '_jwt.xar' v2.0.1 | |
| - name: Check Contents | |
| working-directory: build/ | |
| run: ls | |
| # Install | |
| - name: Start exist-ci containers | |
| run: | | |
| docker run -dit -p 8080:8080 -v ${{ github.workspace }}/build:/exist/autodeploy \ | |
| --name exist --rm --health-interval=1s --health-start-period=2s \ | |
| duncdrum/existdb:${{ matrix.exist-version }}-slim | |
| - name: Wait for server to start | |
| timeout-minutes: 1 | |
| run: | | |
| echo "Waiting for server to start..." | |
| until docker logs exist 2>&1 | grep -q "Server has started"; do | |
| echo "Still waiting..." | |
| sleep 4 | |
| done | |
| # Test | |
| - name: Run smoke test | |
| run: bats --tap test/*.bats | |
| - name: debug logs | |
| if: failure() | |
| run: docker logs exist | grep 'ERROR' | |
| - name: Copy logs on failure | |
| if: failure() | |
| run: | | |
| echo "Copying logs..." | |
| docker cp exist:/exist/logs/exist.log ./exist.log | |
| - name: Upload logs artifact | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: jinks-exist-${{ matrix.exist-version }}-log | |
| path: exist.log | |
| - name: Run Cypress e2e test | |
| if: matrix.experimental != true | |
| uses: cypress-io/github-action@v7 | |
| with: | |
| browser: firefox | |
| - name: Run Cypress e2e test (expect fail) | |
| if: matrix.experimental == true | |
| continue-on-error: true | |
| uses: cypress-io/github-action@v7 | |
| with: | |
| browser: firefox | |
| - name: Upload cypress sceenshots | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: CiM-exist-${{ matrix.exist-version }}-${{ matrix.webcomponents-version || 'default' }}-screenshots | |
| path: test/cypress/screenshots/ |