|
1 | | -name: CI |
| 1 | +name: Build |
| 2 | + |
2 | 3 | on: [push, pull_request] |
| 4 | + |
3 | 5 | jobs: |
4 | 6 | build: |
5 | | - name: Exist ${{ matrix.exist-version }} (Java ${{ matrix.java-version }}) build and test |
6 | | - strategy: |
7 | | - fail-fast: false |
8 | | - matrix: |
9 | | - exist-version: [latest, 6.2.0] |
10 | | - java-version: ['8', '21'] |
11 | | - os: [ubuntu-latest] |
12 | | - exclude: |
13 | | - - exist-version: 6.2.0 |
14 | | - java-version: 21 |
15 | | - - exist-version: latest |
16 | | - java-version: 8 |
17 | | - |
18 | | - runs-on: ${{ matrix.os }} |
| 7 | + name: Build XAR |
| 8 | + runs-on: ubuntu-latest |
19 | 9 | steps: |
20 | 10 | - uses: actions/checkout@v6 |
21 | | - - name: Set up JDK ${{ matrix.java-version }} |
22 | | - uses: actions/setup-java@v5 |
| 11 | + - uses: actions/setup-node@v6 |
23 | 12 | with: |
24 | | - distribution: temurin |
25 | | - cache: maven |
26 | | - java-version: ${{ matrix.java-version }} |
27 | | - - name: Install Test Dependencies |
28 | | - run: | |
29 | | - sudo apt-get update |
30 | | - sudo apt-get install -y bats |
31 | | -
|
32 | | - - name: Maven Build |
33 | | - run: mvn clean package |
34 | | - |
35 | | - - name: set min templating version from pom |
36 | | - run: | |
37 | | - echo "TEMPLATING_VERSION=$(mvn help:evaluate -Dexpression=templating.version -q -DforceStdout)" >> $GITHUB_ENV |
38 | | -
|
39 | | - - name: Add expath dependencies |
40 | | - working-directory: target |
41 | | - run: | |
42 | | - wget http://exist-db.org/exist/apps/public-repo/public/templating-${{ env.TEMPLATING_VERSION }}.xar -O 001.xar |
43 | | -
|
| 13 | + node-version: 'lts/*' |
| 14 | + - run: npm ci --ignore-scripts |
| 15 | + - run: npm run build |
| 16 | + - name: Upload XAR |
| 17 | + uses: actions/upload-artifact@v4 |
| 18 | + with: |
| 19 | + name: exist-function-documentation-xar |
| 20 | + path: dist/*.xar |
44 | 21 |
|
45 | | - # Install |
46 | | - - name: Start exist-ci containers |
47 | | - run: | |
48 | | - docker run -dit -p 8080:8080 -v ${{ github.workspace }}/target:/exist/autodeploy \ |
49 | | - --name exist --rm --health-interval=1s --health-start-period=1s \ |
50 | | - duncdrum/existdb:${{ matrix.exist-version }} |
51 | | - |
52 | | - - name: wait for install to finish |
53 | | - timeout-minutes: 5 |
| 22 | + test: |
| 23 | + name: Test (eXist latest) |
| 24 | + needs: build |
| 25 | + runs-on: ubuntu-latest |
| 26 | + services: |
| 27 | + exist: |
| 28 | + image: existdb/existdb:latest |
| 29 | + ports: |
| 30 | + - 8080:8080 |
| 31 | + - 8443:8443 |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v6 |
| 34 | + - uses: actions/setup-node@v6 |
| 35 | + with: |
| 36 | + node-version: 'lts/*' |
| 37 | + - run: npm ci --ignore-scripts |
| 38 | + - name: Install Cypress binary |
| 39 | + run: npx cypress install |
| 40 | + - run: npm run build |
| 41 | + - name: Install dependency XARs |
54 | 42 | run: | |
55 | | - while ! docker logs exist | grep -q "Server has started"; \ |
56 | | - do sleep 6s; \ |
57 | | - done |
58 | | -
|
59 | | - # Test |
60 | | - - name: Run smoke test |
61 | | - run: bats --tap src/test/bats/*.bats |
62 | | - |
63 | | - - name: Run e2e test |
| 43 | + TEMPLATING_VERSION=$(node -p "require('./package.json').app.templatingVersion || '1.2.1'") |
| 44 | + wget -q "http://exist-db.org/exist/apps/public-repo/public/templating-${TEMPLATING_VERSION}.xar" |
| 45 | + npx --yes @existdb/xst package install "templating-${TEMPLATING_VERSION}.xar" |
| 46 | + env: |
| 47 | + EXISTDB_USER: admin |
| 48 | + EXISTDB_PASS: |
| 49 | + - name: Install XAR |
| 50 | + run: npx --yes @existdb/xst package install dist/exist-function-documentation-*.xar |
| 51 | + env: |
| 52 | + EXISTDB_USER: admin |
| 53 | + EXISTDB_PASS: |
| 54 | + - name: Run Cypress tests |
64 | 55 | run: npx cypress run |
65 | 56 |
|
66 | | - # - name: Test |
67 | | - # env: |
68 | | - # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} |
69 | | - # run: mvn verify |
| 57 | + release: |
| 58 | + name: Release |
| 59 | + runs-on: ubuntu-latest |
| 60 | + needs: test |
| 61 | + if: github.ref == 'refs/heads/master' |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v6 |
| 64 | + with: |
| 65 | + fetch-depth: 0 |
| 66 | + - uses: actions/setup-node@v6 |
| 67 | + with: |
| 68 | + node-version: 'lts/*' |
| 69 | + - run: npm ci --ignore-scripts |
| 70 | + - run: npx semantic-release |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments