add connection event listener support similar to node-redis #1288
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: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
env: | |
# TODO: Remove `DENO_FUTURE=1` once lockfile v4 is stabilized | |
# https://github.com/denoland/deno/pull/25059 | |
DENO_FUTURE: 1 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
redis: [6.2, 7.4] | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get Deno version | |
run: | | |
echo "DENO_VERSION=$(cat .denov)" >> $GITHUB_ENV | |
- name: Set up Deno ${{ env.DENO_VERSION }} | |
uses: denoland/setup-deno@main | |
with: | |
deno-version: ${{ env.DENO_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.deno | |
~/.cache/deno | |
key: ${{ runner.os }}-deno-${{ hashFiles('deps/**', '.denov', 'deno.lock') }} | |
- name: Check mod.ts | |
run: | | |
deno task make_mod | |
git diff --exit-code | |
deno check mod.ts | |
- name: Set up Redis ${{ matrix.redis }} | |
uses: shogo82148/actions-setup-redis@v1 | |
with: | |
redis-version: ${{ matrix.redis }} | |
auto-start: "true" | |
- name: Run tests | |
run: | | |
deno task test | |
env: | |
REDIS_VERSION: ${{ matrix.redis }} | |
- name: Run doc tests | |
run: | | |
deno task test:doc | |
- name: Generate an lcov report | |
run: | | |
deno task coverage | |
- uses: k1LoW/octocov-action@v0 | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get Deno version | |
run: | | |
echo "DENO_VERSION=$(cat .denov)" >> $GITHUB_ENV | |
- name: Set up Deno ${{ env.DENO_VERSION }} | |
uses: denoland/setup-deno@main | |
with: | |
deno-version: ${{ env.DENO_VERSION }} | |
- name: Run linters | |
run: | | |
deno fmt --check | |
deno lint | |
deno task check:deno-json | |
- name: deno publish --dry-run | |
run: | |
deno publish --dry-run | |
benchmark: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
redis: [7.4] | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get Deno version | |
run: | | |
echo "DENO_VERSION=$(cat .denov)" >> $GITHUB_ENV | |
- name: Set up Deno ${{ env.DENO_VERSION }} | |
uses: denoland/setup-deno@main | |
with: | |
deno-version: ${{ env.DENO_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.deno | |
~/.cache/deno | |
key: ${{ runner.os }}-deno-benchmark-${{ hashFiles('deps/**', '.denov', 'deno.lock') }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- uses: bahmutov/npm-install@v1 | |
with: | |
working-directory: benchmark | |
- name: Set up Redis ${{ matrix.redis }} | |
uses: shogo82148/actions-setup-redis@v1 | |
with: | |
redis-version: ${{ matrix.redis }} | |
auto-start: "true" | |
- name: Run benchmarks (ioredis) | |
run: | | |
deno task bench:ioredis | |
- name: Run benchmarks (deno-redis) | |
run: | | |
deno task bench:deno-redis | |
- name: Output results as a job summary | |
run: | | |
deno run --allow-read=tmp tools/format-benchmark-results.js >> $GITHUB_STEP_SUMMARY |