chore(deps): update dependency eslint-config-prettier to v9 (#1303) #3409
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 & Release | |
# Workflow name based on selected inputs. Fallback to default Github naming when expression evaluates to empty string | |
run-name: >- | |
${{ | |
inputs.release && 'Publish to NPM' || | |
'' | |
}} | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'Publish new release' | |
required: true | |
default: false | |
type: boolean | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read # for checkout | |
jobs: | |
build: | |
name: Lint and build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
node-version: lts/* | |
- run: npm ci | |
- run: npx ls-engines | |
- run: npm run prepublishOnly | |
- name: lint, prettier --check | |
run: npm run lint | |
- name: build:lib, test:integration | |
run: | | |
npm run build:lib | |
npm run test:integration | |
test: | |
needs: [build] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Run the testing suite on each major OS with the latest LTS release of Node.js | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
node: [lts/*] | |
# It makes sense to also test the oldest, and latest, versions of Node.js, on ubuntu-only since it's the fastest CI runner | |
include: | |
- os: ubuntu-latest | |
# Test the oldest LTS release of Node that's still receiving bugfixes and security patches, versions older than that have reached End-of-Life | |
node: lts/-2 | |
- os: ubuntu-latest | |
# Also test the previous LTS release | |
node: lts/-1 | |
- os: ubuntu-latest | |
# Test the actively developed version that will become the latest LTS release next October | |
node: current | |
# The `build` job already runs the testing suite in ubuntu and lts/* | |
exclude: | |
- os: ubuntu-latest | |
# Test the oldest LTS release of Node that's still receiving bugfixes and security patches, versions older than that have reached End-of-Life | |
node: lts/* | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
node-version: ${{ matrix.node }} | |
- run: npm install | |
- run: npx ls-engines | |
- name: build:lib, test:integration | |
run: | | |
npm run build:lib | |
npm run test:integration | |
browser: | |
name: Test browser.js | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
node-version: lts/* | |
- run: npm ci | |
- name: build:browser.js, test:browser.js | |
run: | | |
npm run build:browser.js | |
npm run test:browser.js | |
e2e: | |
name: Run integration tests on real redis | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis:7.0.12 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
node-version: lts/* | |
- run: npm ci | |
- name: test:e2e | |
run: npm run test:e2e -- --forceExit | |
# run: npm run test:e2e -- --openHandlesTimeout=60000 | |
# timeout-minutes: 2 | |
# - name: Find open handles | |
# if: failure() | |
# run: | | |
# npm run test:e2e -- --detectOpenHandles --forceExit | |
#env: | |
# DEBUG: ioredis:* | |
release: | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
id-token: write # to enable use of OIDC for npm provenance | |
needs: [build, test, browser, e2e] | |
# only run if opt-in during workflow_dispatch | |
if: github.event.inputs.release == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Need to fetch entire commit history to | |
# analyze every commit since last release | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: npm | |
- run: npm ci --ignore-scripts | |
- run: npm audit signatures | |
# Branches that will release new versions are defined in .releaserc.json | |
- run: npx semantic-release | |
# Don't allow interrupting the release step if the job is cancelled, as it can lead to an inconsistent state | |
# e.g. git tags were pushed but it exited before `npm publish` | |
if: always() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |