Skip to content

Commit

Permalink
Setup Github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
weyoss committed Sep 16, 2021
1 parent acb163a commit 5d3785d
Show file tree
Hide file tree
Showing 8 changed files with 379 additions and 8 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This is a basic workflow to help you get started with Actions

name: Tests & Coverage

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ ci ]

pull_request:
branches: [ ci ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# Label of the container job
tests-run:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: node:10.18-jessie

# Service containers to run with `container-job`
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2

# Performs a clean installation of all dependencies in the `package.json` file
# For more information, see https://docs.npmjs.com/cli/ci.html
- name: Install dependencies
run: npm ci

- name: Check type coverage
run: npm run type-coverage

- name: Run tests
run: npm test
env:
# The hostname used to communicate with the Redis service container
REDIS_HOST: redis
# The default Redis port
REDIS_PORT: 6379

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
if: success()
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# compiled output
/dist
/node_modules
/docs/coverage

# Logs
logs
Expand Down
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist/tests
docs/coverage
examples
src/**
tests/**
Expand All @@ -11,4 +10,6 @@ index.ts
tsconfig.json
jest.config.js
.idea
types/**
types/**
coverage/**
.github/**
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# RedisSMQ - Yet another simple Redis message queue

![example workflow](https://github.com/weyoss/redis-smq/actions/workflows/main/badge.svg)
![Coverage Status](https://coveralls.io/repos/weyoss/redis-smq/badge.svg?branch=ci)


A simple high-performance Redis message queue for Node.js.

For more details about RedisSMQ design see [https://medium.com/@weyoss/building-a-simple-message-queue-using-redis-server-and-node-js-964eda240a2a](https://medium.com/@weyoss/building-a-simple-message-queue-using-redis-server-and-node-js-964eda240a2a)
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
rootDir: path.resolve('./'),
testMatch: ['**/dist/**/*.test.js'],
setupFilesAfterEnv: ['<rootDir>/dist/tests/jest.setup.js'],
coverageDirectory: '<rootDir>/docs/coverage',
coverageDirectory: '<rootDir>/coverage',
collectCoverage: true,
};

0 comments on commit 5d3785d

Please sign in to comment.