Skip to content

fix: add swarm-collection to cors headers #36

fix: add swarm-collection to cors headers

fix: add swarm-collection to cors headers #36

Workflow file for this run

name: Test Batch
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
test-buy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run bee-dev
run: npx bee-dev &
- name: Wait for bee-dev
run: npx npxie await http://localhost:1633/stamps
- name: Run gateway once to buy batch
run: DATABASE_CONFIG={} TEMPORARY=5 POSTAGE_AMOUNT=414720001 POSTAGE_DEPTH=20 node dist
- name: Verify 1st batch has been bought
run: npx npxie json-equals http://localhost:1633/stamps stamps.length 1
- name: Re-run gateway to buy because of expired batch
run: DATABASE_CONFIG={} TEMPORARY=5 POSTAGE_AMOUNT=414720001 POSTAGE_DEPTH=20 POSTAGE_THRESHOLD_SECONDS=100000 node dist
- name: Verify 2nd batch has been bought
run: npx npxie json-equals http://localhost:1633/stamps stamps.length 2
test-extend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run bee-dev
run: npx bee-dev &
- name: Wait for bee-dev
run: npx npxie await http://localhost:1633/stamps
- name: Run gateway once to buy batch
run: DATABASE_CONFIG={} TEMPORARY=5 POSTAGE_AMOUNT=414720001 POSTAGE_DEPTH=20 POSTAGE_KEEP_ALIVE=true node dist
- name: Verify batch TTL is 1 day
run: npx npxie json-equals http://localhost:1633/stamps stamps.0.batchTTL 86400
- name: Re-run gateway to top up the batch
run: DATABASE_CONFIG={} TEMPORARY=5 POSTAGE_AMOUNT=414720001 POSTAGE_DEPTH=20 POSTAGE_KEEP_ALIVE=true POSTAGE_THRESHOLD_SECONDS=100000 node dist
- name: Verify batch TTL is 2 days
run: npx npxie json-equals http://localhost:1633/stamps stamps.0.batchTTL 172800