-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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-14, windows-latest] | ||
node: [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@v4 | ||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
# we lock to 3.11 for a distutils requirement for node-gyp | ||
python-version: '3.11' | ||
- name: Prepare Install (if applicable) | ||
run: node prepare-install.js | ||
- name: Enable Corepack | ||
run: corepack enable npm | ||
- name: Install Dependencies | ||
run: npm install | ||
- name: Prettier | ||
if: matrix.os == 'ubuntu-latest' | ||
run: npm run prettier-check | ||
- name: Build | ||
run: npm run build | ||
- name: Run Tests | ||
env: | ||
BULL_REDIS_CONNECTION: ${{ (matrix.os == 'ubuntu-latest') && 'redis://127.0.0.1:6379/0' || '' }} | ||
run: npm run ${{ (matrix.os == 'ubuntu-latest') && 'test-verbose' || 'test' }} | ||
- 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 semantic-release@19.0.5 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: PR | ||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
pull_request_target: | ||
types: [opened, edited, synchronize] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@0b14f54ac155d88e12522156e52cb6e397745cfd | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |