Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions .circleci/config.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build

test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run unit tests
run: npx jest --ci --runInBand --reporters=default --reporters=jest-junit --coverage
env:
JEST_JUNIT_OUTPUT: reports/jest/results.xml
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: reports
if-no-files-found: warn
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/lcov-report
if-no-files-found: warn
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

publish:
name: Publish
needs:
- build
- test
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NodeJS GCloud Pub/Sub module

[![CircleCI](https://circleci.com/gh/ecobee/nodejs-gcloud-pubsub-module.svg?style=svg&circle-token=fbf98de8e837e22ab817ad943bd540fd40684955)](https://circleci.com/gh/ecobee/nodejs-gcloud-pubsub-module)
[![CI](https://github.com/ecobee/nodejs-gcloud-pubsub-module/actions/workflows/ci.yml/badge.svg)](https://github.com/ecobee/nodejs-gcloud-pubsub-module/actions/workflows/ci.yml)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The GitHub Actions workflow file (.github/workflows/ci.yml) referenced by this badge is missing from the pull request. Please add the workflow file to complete the migration from CircleCI to GitHub Actions.

[![codecov](https://codecov.io/gh/ecobee/nodejs-gcloud-pubsub-module/branch/master/graph/badge.svg?token=F93WezHhBy)](https://codecov.io/gh/ecobee/nodejs-gcloud-pubsub-module)

A Google Cloud Pub/Sub library for the [NestJS](https://github.com/nestjs/nest) framework. Easily subscribe or publish to topics in Google Pub/Sub.
Expand Down
28 changes: 19 additions & 9 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
const ABORTED = 10
const CANCELLED = 1
const DEADLINE_EXCEEDED = 4
const INTERNAL = 13
const RESOURCE_EXHAUSTED = 8
const UNAVAILABLE = 14
const UNKNOWN = 2
const NOT_FOUND = 5
const PERMISSION_DENIED = 7

export const PUB_SUB_DEFAULT_RETRY_CODES = [
10, // 'ABORTED'
1, // 'CANCELLED',
4, // 'DEADLINE_EXCEEDED'
13, // 'INTERNAL'
8, // 'RESOURCE_EXHAUSTED'
14, // 'UNAVAILABLE'
2, // 'UNKNOWN'
5, // NOT_FOUND'
7, // PERMISSION_DENIED
ABORTED,
CANCELLED,
DEADLINE_EXCEEDED,
INTERNAL,
RESOURCE_EXHAUSTED,
UNAVAILABLE,
UNKNOWN,
NOT_FOUND,
PERMISSION_DENIED,
]

export const PUB_SUB_DEFAULT_BACKOFF_SETTINGS = {
Expand Down
Loading