update HttpApiClient #264
This file contains 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: CI | |
on: | |
push: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Run unittests.test.ts | |
run: | | |
deno test --coverage=testdata/coverage --unstable -A tests/unittests.test.ts | |
- name: Run test.ts | |
run: | | |
mkdir -p testdata | |
deno test \ | |
--allow-read=testdata --allow-write=testdata \ | |
--allow-env \ | |
--coverage=testdata/coverage \ | |
tests/test.ts | |
- name: Analyze coverage | |
run: | | |
deno coverage testdata/coverage --lcov > testdata/coverage.lcov | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./testdata/coverage.lcov | |
fail_ci_if_error: true | |
name: test | |
test-in-memory: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Run test.ts | |
run: | | |
mkdir -p testdata | |
deno test \ | |
--allow-read=testdata --allow-write=testdata \ | |
--allow-env \ | |
--coverage=testdata/coverage \ | |
tests/test.ts -- --in-memory | |
- name: Analyze coverage | |
run: | | |
deno coverage testdata/coverage --lcov > testdata/coverage.lcov | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./testdata/coverage.lcov | |
fail_ci_if_error: true | |
name: test-in-memory | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Check fmt | |
run: deno fmt --check | |
node: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [ '14', '16' ] | |
name: node v${{ matrix.node }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Setup Node v${{ matrix.node }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install deps with pnpm | |
run: | | |
curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6 | |
pnpm install --frozen-lockfile | |
- name: Build bundle for Node | |
run: | | |
pnpm run build | |
- name: Upload bundle to artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: btrdb-node | |
path: | | |
dist/btrdb.* | |
dist/nodeTest.* | |
- name: Run tests in Node | |
run: | | |
mkdir -p testdata | |
node nodeCompat/example.js && \ | |
pnpm run nodetest | |
perf: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Run test.ts without "deno test" | |
run: | | |
mkdir -p testdata | |
deno run --allow-read=testdata --allow-write=testdata tests/test.ts run | |
test-pagesize: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
page_size: | |
- 128 | |
- 256 | |
- 512 | |
- 1024 | |
- 2048 | |
- 4096 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Run test.ts (page size ${{ matrix.page_size }}) | |
run: | | |
BTRDB_PAGESIZE=${{ matrix.page_size }} \ | |
deno test \ | |
--allow-read=testdata --allow-write=testdata \ | |
--allow-env \ | |
--coverage=testdata/coverage \ | |
tests/test.ts -- --in-memory | |
- name: Analyze coverage | |
run: | | |
deno coverage testdata/coverage --lcov > testdata/coverage.lcov | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./testdata/coverage.lcov | |
fail_ci_if_error: true | |
name: pagesize-${{ matrix.page_size }} |