-
Notifications
You must be signed in to change notification settings - Fork 146
52 lines (49 loc) · 1.52 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CI
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [16, 18, 20]
runs-on: ${{ matrix.os }}
services:
redis:
# See workaround https://github.com/actions/runner/issues/822#issuecomment-1524826092
image: ${{ (matrix.os == 'ubuntu-latest') && 'redis:6.0.20' || '' }}
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Prepare Install (if applicable)
run: node prepare-install.js
- name: Install Dependencies
run: yarn install --network-timeout 1000000
- name: Build
run: yarn build
- name: Run Tests
env:
BULL_REDIS_CONNECTION: ${{ (matrix.os == 'ubuntu-latest') && 'redis://127.0.0.1:6379/0' || '' }}
run: yarn test-verbose
- name: Maybe Release
if: matrix.os == 'ubuntu-latest' && matrix.node == 18 && github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
run: npx [email protected]