diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index cae63e3..0000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: 1 -update_configs: - - package_manager: "javascript" - directory: "/" - update_schedule: "daily" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 646cb17..5e48d4e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,12 @@ version: 2 updates: - - package-ecosystem: "npm" - directory: "/" + - package-ecosystem: github-actions + directory: '/' schedule: - interval: "daily" + interval: daily + open-pull-requests-limit: 10 + - package-ecosystem: npm + directory: '/' + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fad5461..db83e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,40 +1,44 @@ - name: CI on: push: - branches: [ master ] + paths-ignore: + - 'docs/**' + - '*.md' pull_request: - branches: [ master ] + paths-ignore: + - 'docs/**' + - '*.md' jobs: test: runs-on: ubuntu-latest + strategy: matrix: node-version: [10.x, 12.x, 14.x] - services: - kafka: - image: confluentinc/cp-kafka - ports: - - 9092:9092 + steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2.1.5 - with: - node-version: ${{ matrix.node-version }} - - name: Install Dependencies - run: npm install --ignore-scripts - - name: Test - run: npm test + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2.1.5 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: | + npm install --ignore-scripts + + - name: Run Tests + run: | + npm run infra:start + npm run test automerge: - needs: test - runs-on: ubuntu-latest - steps: - - uses: fastify/github-action-merge-dependabot@v2.0.0 - if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} - with: - github-token: ${{secrets.github_token}} + needs: test + runs-on: ubuntu-latest + steps: + - uses: fastify/github-action-merge-dependabot@v2.0.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8f0b6b1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: node_js - -node_js: - - "14" - - "12" - - "10" - -services: - - docker - -before_script: - - docker-compose up -d - - sleep 60 - - docker-compose ps - -script: - - npm test - -after_script: - - docker-compose down - -notifications: - email: - on_success: never - on_failure: always diff --git a/README.md b/README.md index 9c64e01..6908711 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # fastify-kafka -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://travis-ci.org/fastify/fastify-kafka.svg?branch=master)](https://travis-ci.org/fastify/fastify-kafka) +![CI](https://github.com/fastify/fastify-kafka/workflows/CI/badge.svg) +[![NPM version](https://img.shields.io/npm/v/fastify-kafka.svg?style=flat)](https://www.npmjs.com/package/fastify-kafka) +[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-kafka/badge.svg)](https://snyk.io/test/github/fastify/fastify-kafka) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) Fastify plugin to interact with [Apache Kafka](http://kafka.apache.org/). Supports Kafka producer and consumer. -To achieve the best performances internally uses [`node-rdkafka`](https://github.com/Blizzard/node-rdkafka). +To achieve the best performance, the plugin uses [`node-rdkafka`](https://github.com/Blizzard/node-rdkafka). ### Install @@ -71,7 +74,7 @@ This module exposes the following apis: ## Acknowledgements This project is kindly sponsored by: -- [LetzDoIt](http://www.letzdoitapp.com/) +- [LetzDoIt](https://www.letzdoitapp.com/) ## License diff --git a/docker-compose.yml b/docker-compose.yml index fd9d07b..355c21d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,21 @@ ---- -zookeeper: - image: confluentinc/cp-zookeeper - ports: - - "2181:2181" - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 -kafka: - image: confluentinc/cp-kafka - links: - - zookeeper - ports: - - "9092:9092" - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181' - KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092' - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 +version: "3.9" +services: + zookeeper: + image: confluentinc/cp-zookeeper + ports: + - "2181:2181" + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + kafka: + image: confluentinc/cp-kafka + links: + - zookeeper + ports: + - "9092:9092" + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181' + KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092' + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 diff --git a/package.json b/package.json index 1b545c4..32c542b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "types": "index.d.ts", "scripts": { - "infra:start": "docker-compose up", + "infra:start": "docker-compose up -d", "infra:stop": "docker-compose stop", "test": "standard && tsd && tap -j=1 test/*.js" },