fix: refactor search functions to use fetchAllPages for pagination an… #58
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
| name: Release | |
| on: | |
| push: | |
| branches: [ main, release ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| test: | |
| name: Test (Node ${{ matrix.node }} - Camunda ${{ matrix.camunda }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| node: [22, 24] | |
| camunda: ['8.8', '8.9'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| - name: Start Camunda ${{ matrix.camunda }} with Docker Compose | |
| working-directory: assets/c8/${{ matrix.camunda }} | |
| run: docker compose up -d | |
| - name: Wait for Camunda to be ready | |
| run: | | |
| echo "Waiting for Camunda at localhost:8080..." | |
| # First wait for topology endpoint | |
| for i in {1..60}; do | |
| if curl -s -f -u demo:demo http://localhost:8080/v2/topology > /dev/null; then | |
| echo "Topology endpoint is ready!" | |
| break | |
| fi | |
| echo "Attempt $i: Topology not ready yet, waiting..." | |
| sleep 5 | |
| done | |
| # Then wait an additional 30 seconds for broker to fully initialize | |
| echo "Waiting additional time for broker to initialize..." | |
| sleep 30 | |
| # Verify we can actually deploy | |
| echo "Testing deployment capability..." | |
| for i in {1..30}; do | |
| if curl -s -u demo:demo http://localhost:8080/v2/topology | grep -q '"health":"healthy"'; then | |
| echo "Broker is healthy, ready for deployments!" | |
| exit 0 | |
| fi | |
| echo "Attempt $i: Broker not fully ready, waiting..." | |
| sleep 2 | |
| done | |
| echo "Camunda may not be fully ready, but continuing with tests..." | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| env: | |
| CAMUNDA_VERSION: ${{ matrix.camunda }} | |
| - name: Stop Camunda | |
| if: always() | |
| working-directory: assets/c8/${{ matrix.camunda }} | |
| run: docker compose down -v | |
| - name: Show Camunda logs on failure | |
| if: failure() | |
| working-directory: assets/c8/${{ matrix.camunda }} | |
| run: docker compose logs | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js 22.18.0 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.18.0 | |
| cache: 'npm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Smoke GitHub OIDC token exchange for npm publish | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| REG=$(npm -s config get registry||:); REG=${REG%/}; : "${REG:=https://registry.npmjs.org}" | |
| HOST=${REG#*://}; HOST=${HOST%%/*} | |
| ID=$(curl -fsS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=npm:${HOST}" | jq -er .value) | |
| PKG=$(jq -r '.name|@uri' package.json) | |
| RESP=$(curl -fsS -H "Authorization: Bearer $ID" "$REG/-/npm/v1/oidc/token/exchange/package/$PKG" -d "") | |
| TOKEN=$(echo "$RESP" | jq -er '.token') | |
| echo "::add-mask::$TOKEN" | |
| [ -n "$TOKEN" ] | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Disabled while repo is private. See: https://github.com/camunda/c8ctl/issues/12 | |
| NPM_CONFIG_PROVENANCE: 'false' | |
| run: NODE_AUTH_TOKEN="" npx semantic-release |