[pull] master from probot:master #251
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: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
permissions: | |
contents: read | |
jobs: | |
dependency-review: | |
name: Dependency Review | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Dependency review | |
uses: actions/dependency-review-action@v4 | |
license-check: | |
name: Check Licenses | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: npm ci | |
- name: Check Licenses | |
run: npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;Apache 2.0;Python-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT" | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
test-unit: | |
name: Test on Node ${{ matrix.node-version }} and ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: | |
- 18 | |
- 20 | |
- 22 | |
- latest | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Test | |
run: npm run test | |
test-redis: | |
name: Test on Node LTS and Redis 7 | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: 'redis:7' | |
ports: | |
- '6379:6379' | |
options: '--entrypoint redis-server' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Use Node.js LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: npm | |
- name: Install Dependencies | |
run: npm ci | |
- name: Test | |
run: npm run test | |
env: | |
REDIS_HOST: 127.0.0.1 | |
test: | |
runs-on: ubuntu-latest | |
needs: | |
- test-unit | |
- test-redis | |
steps: | |
- run: exit 1 | |
if: ${{ needs.test-unit.result != 'success' || needs.test-redis.result != 'success' }} | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Use Node.js LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: npm | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test:coverage | |
- name: Update Codecov | |
run: npx codecov | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
if: ${{ always() }} |