Skip to content

Commit

Permalink
ci: add GitHub Actions CI (#17)
Browse files Browse the repository at this point in the history
* remove appveyor and travis configs
* lint: prefer-template
* asn: wait longer for dns test
* more es6/7 style
  • Loading branch information
msimerson authored May 23, 2022
1 parent ae1c294 commit d2213d5
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
engines:
eslint:
enabled: true
channel: "eslint-3"
channel: "eslint-8"
config:
config: ".eslintrc.yaml"

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on: [ push ]

env:
CI: true

jobs:

ci-test:

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

strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: [ 14, 16, 18 ]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
with:
node-version: ${{ matrix.node-version }}

- run: npm install
- run: npm test
32 changes: 32 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Coverage

# on: [ push ] # use this for non-plugins
# haraka-plugin-*, dummy event that never triggers
on: [ milestone ]

jobs:

coverage:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install
run: |
npm install
npm install --no-save nyc codecov
- run: npx nyc --reporter=lcovonly npm test
env:
NODE_ENV: cov

- name: Submit to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on: [ push ]

env:
CI: true
node_version: 14

jobs:

lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
name: Node.js ${{ env.node_version }}
with:
node-version: ${{ env.node_version }}

- run: npm install
- run: npm run lint
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish

on:
release:
types: [ published ]

env:
node_version: 16

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- run: npm install
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
registry-url: https://registry.npmjs.org
- run: npm install

- run: npm publish --ignore-scripts --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}
registry-url: https://registry.npmjs.org
- run: npm install
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jspm_packages

# Optional REPL history
.node_repl_history

package-lock.json
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[![Build Status][ci-img]][ci-url]
[![Code Coverage][cov-img]][cov-url]
[![Code Climate][clim-img]][clim-url]
[![Windows Build status][appv-img]][appv-url]
[![Greenkeeper badge][gk-img]][gk-url]
[![Code Climate][clim-img]][clim-url]
[![NPM][npm-img]][npm-url]
<!--[![Code Coverage][cov-img]][cov-url]-->

# haraka-plugin-asn

Expand Down
20 changes: 0 additions & 20 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions config/asn.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
; Supported providers:
; origin.asn.cymru.com
; asn.routeviews.org (used by SpamAssassin)
; asn.rspamd.com (as of 2018-01, it's sssslllloooowwww (+600ms))
; asn.rspamd.com
; origin.asn.spameatingmonkey.net
providers=origin.asn.cymru.com

Expand All @@ -26,7 +26,7 @@ timeout=4
dns=true

; look up in local copy of MaxMind ASN database
geoip=true
geoip=false


[header]
Expand Down
Loading

0 comments on commit d2213d5

Please sign in to comment.