Skip to content

Fix multi-entry batch ordering by time #664

Fix multi-entry batch ordering by time

Fix multi-entry batch ordering by time #664

Workflow file for this run

name: ci
on:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches: [main]
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm run fmt:check
run_tests:
runs-on: ubuntu-latest
needs: format
strategy:
matrix:
node_version: ["20", "24"]
token: ["", "token"]
reductstore_version: ["main", "latest"]
steps:
- uses: actions/checkout@v4
- name: install node js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node_version }}"
- run: npm i
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Run ReductStore
run: docker run -p 8383:8383 -v ${PWD}:/workdir
--env RS_API_TOKEN=${{matrix.token}}
--env RS_LOG_LEVEL=DEBUG
--env RS_EXT_PATH=/tmp
-d reduct/store:${{ matrix.reductstore_version }}
- name: Run tests
run: npm test
env:
RS_API_TOKEN: ${{ matrix.token }}
- name: Print ReductStore logs
if: always()
run: |
for cid in $(docker ps -aq --filter "ancestor=reduct/store:${{ matrix.reductstore_version }}"); do
echo "===== Logs for container ${cid} ====="
docker logs "$cid" || true
done
run_examples:
runs-on: ubuntu-latest
needs: format
strategy:
matrix:
node_version: ["20", "24"]
example: ["HelloWorld.js", "QuickStart.js", "Subscription.js"]
reductstore_version: ["main", "latest"]
steps:
- uses: actions/checkout@v4
- name: install node js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node_version }}"
- run: npm i
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Run ReductStore
run: docker run -p 8383:8383 -d reduct/store:${{ matrix.reductstore_version }}
- name: Wait for ReductStore
run: |
for i in {1..30}; do
if curl -fsS http://127.0.0.1:8383/api/v1/alive >/dev/null; then
echo "ReductStore is ready"
exit 0
fi
sleep 1
done
echo "ReductStore did not become ready in time"
docker logs $(docker ps -q --filter "ancestor=reduct/store:${{ matrix.reductstore_version }}") || true
exit 1
- name: Run example
run: npm run tsc && node examples/${{matrix.example}}
- name: Print ReductStore logs
if: always()
run: |
for cid in $(docker ps -aq --filter "ancestor=reduct/store:${{ matrix.reductstore_version }}"); do
echo "===== Logs for container ${cid} ====="
docker logs "$cid" || true
done
lint:
runs-on: ubuntu-latest
needs: format
steps:
- uses: actions/checkout@v4
- run: npm i
- name: Run tests
run: npm run lint
audit:
runs-on: ubuntu-latest
needs: format
steps:
- uses: actions/checkout@v4
- run: npm i
- name: Fail on high/critical vulnerabilities
run: npm audit --audit-level=high
publish:
needs: [run_tests, run_examples, lint, audit]
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- run: npm i
- name: Determine npm tag
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *"-beta"* ]]; then
echo "NPM_TAG=beta" >> "$GITHUB_ENV"
fi
- name: Publish package
run: |
if [[ -n "${NPM_TAG}" ]]; then
npm publish --tag "${NPM_TAG}"
else
npm publish
fi