Skip to content

Commit

Permalink
ES6 arrow funcs, dep version bumps, test framework (#51)
Browse files Browse the repository at this point in the history
* es6: use arrow functions
* es6: object shorthand
* bump versions for js-yaml & hjson
* lint: allow console
* lint: reduce unused var severity
* replace nodeunit (deprecated) with mocha
* set up github workflows/actions
* remove Travis & Appveyor configs
  • Loading branch information
msimerson committed Oct 11, 2019
1 parent d9a16c9 commit 84cf659
Show file tree
Hide file tree
Showing 28 changed files with 1,290 additions and 1,224 deletions.
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
engines:
eslint:
enabled: true
channel: "eslint-3"
channel: "eslint-4"
config:
config: ".eslintrc"
config: ".eslintrc.yaml"

ratings:
paths:
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ root: true

rules:
indent: [2, 4, {"SwitchCase": 1}]
no-console: 0
no-unused-vars: 1
37 changes: 37 additions & 0 deletions .github/workflows/ci-test-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Windows CI Tests

on: [push]

# no docker/images support on Windows (currently), so run w/o Redis
# also, stack run commands so test doesn't begin before install completes

jobs:

ci-test-win:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ windows-latest ]
node-version: [8.x, 10.x, 12.x]
fail-fast: false

steps:
- uses: actions/checkout@v1
name: git checkout
with:
fetch-depth: 1

- uses: actions/setup-node@v1
name: Use Node.js ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}

- name: npm install and test
run: |
npm install
npm run test
env:
CI: true
41 changes: 41 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Ubuntu CI Tests

on: [ push ]

jobs:

ci-test:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
node-version: [8.x, 10.x, 12.x]
fail-fast: false

steps:
- uses: actions/checkout@v1
name: git checkout
with:
fetch-depth: 1

- uses: actions/setup-node@v1
name: Use Node.js ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}

- name: npm install
run: npm install

- name: Run test suite
run: npm run test

env:
CI: true

services:
redis:
image: redis
ports:
- 6379/tcp
32 changes: 32 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on: [ pull_request ]

name: Test Coverage

jobs:

coverage:
name: Codecov
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@master
name: Checkout haraka-config
with:
fetch-depth: 1

- name: Use Node.js 10
uses: actions/setup-node@master
with:
version: 10.x

- name: install, run
run: |
npm install
npm install nyc codecov
npm run cover
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint

on: [ push ]

jobs:

lint:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 12.x ]

steps:
- uses: actions/checkout@v1
name: git checkout
with:
fetch-depth: 1

- uses: actions/setup-node@v1
name: Use Node.js ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}

- name: npm install
run: npm install

- name: Lint using eslint
run: npm run lint

env:
CI: true
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

20 changes: 19 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## 1.0.18

## 1.N.NN - 20YY-MM-DD


## 1.0.18 - 2019-10-11

- add support for loading `.js` configurations


## 1.0.17 - 2018-12-19

- refactor ./config.js as an es6 class
Expand All @@ -10,11 +15,13 @@
- watch: recursive=true
- permit retrieval of fully qualified path


## 1.0.16 - 2018-11-02

- remove trailing ; from function declarations
- add config.getInt(filename, default_value)


## 1.0.15 - 2017-09-21

- additional test for 'missing json loads yaml'
Expand All @@ -23,29 +30,35 @@
- configs w/o .ext or declared type default to flat
- add test for json/yaml !filename overloads


## 1.0.14 - 2017-09-19

- add __dirname/../../config to config_dir_candidates for haraka/Haraka/tests/*
- sync process.env.HARAKA_TEST_DIR from haraka/Haraka/config
- eslint no-var updates #25


## 1.0.13 - 2017-06-16

- lint updates for eslint 4


## 1.0.12 - 2017-05-21

- unref() the setInterval so that Haraka can gracefully exit


## 1.0.11 - 2017-03-04

- add config.getDir, loads all files in a directory


## 1.0.10 - 2017-02-05

- log error vs throw on bad YAML
- fix appveyor badge URL


## 1.0.9 - 2017-01-27

- config cache fix (see haraka/Haraka#1738)
Expand All @@ -55,23 +68,28 @@
- use haraka-eslint plugin (vs local copy of .eslintrc)
- lint updates


## 1.0.8 - 2017-01-02

- version bump, lint updates & sync
- lint fixes


## 1.0.7 - 2016-11-17

- update tests for appveyor (Windows) compatibility #9


## 1.0.6 - 2016-11-10

- handle invalid .ini lines properly (skip them)


## 1.0.5 - 2016-10-25

- do not leave behind a `*` section in config (due to wildcard boolean)


## 1.0.3

- added wildcard boolean support
Expand Down
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[![Build Status][ci-img]][ci-url]
[![Coverage Status][cov-img]][cov-url]
[![Code Climate][clim-img]][clim-url]
[![Windows Build status][apv-img]][apv-url]
[![Greenkeeper badge][gk-img]][gk-url]

# haraka-config

Expand Down Expand Up @@ -334,14 +329,3 @@ in a plugins register() function are read *before* Haraka drops privileges.
Be sure that Haraka's user/group has permission to read these files else
Haraka will be unable to update them after changes.


[ci-img]: https://travis-ci.org/haraka/haraka-config.svg?branch=master
[ci-url]: https://travis-ci.org/haraka/haraka-config
[cov-img]: https://codecov.io/github/haraka/haraka-config/coverage.svg
[cov-url]: https://codecov.io/github/haraka/haraka-config?branch=master
[clim-img]: https://codeclimate.com/github/haraka/haraka-config/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-config
[apv-img]: https://ci.appveyor.com/api/projects/status/9qh720gq77e2h5x4?svg=true
[apv-url]: https://ci.appveyor.com/project/msimerson/haraka-config
[gk-img]: https://badges.greenkeeper.io/haraka/haraka-config.svg
[gk-url]: https://greenkeeper.io/
20 changes: 0 additions & 20 deletions appveyor.yml

This file was deleted.

Loading

0 comments on commit 84cf659

Please sign in to comment.