diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml new file mode 100644 index 0000000..a38072c --- /dev/null +++ b/.github/workflows/ci-test.yml @@ -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 diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml new file mode 100644 index 0000000..b97cbd8 --- /dev/null +++ b/.github/workflows/coveralls.yml @@ -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 }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4c04735 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: Lint + +on: [ push ] + +env: + CI: true + node_version: 16 + +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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1d0e575 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a3dcbe7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -node_js: - - "10" - - "12" - - "13" - -services: -# https://docs.travis-ci.com/user/database-setup/ - -before_script: - -script: - - npm run lint - - npm test - -after_success: - - npm install nyc codecov - - npm run cover - - npx codecov - -sudo: false diff --git a/Changes.md b/Changes.md index 9258ad2..a163ab6 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,9 @@ + +- ci: add node 18 testing +- ci: replace travis & appveyor with github actions + + ### 1.0.3 - 2020-01-17 - Use es6 classes on full - static members instead of old style `exports.stuff` diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4910e60..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,20 +0,0 @@ -environment: - nodejs_version: "10" - -install: - - ps: Install-Product node $env:nodejs_version - - npm install - -before_build: -build: off -after_build: - -before_test: - - node --version - - npm --version - -test_script: - - npm test - -after_test: - diff --git a/package.json b/package.json index fb959f2..748f4d6 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.3", "description": "Haraka DSN", "engines": { - "node": ">= v10.18.1" + "node": ">= v14.0.0" }, "main": "index.js", "scripts": { @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/haraka/haraka-dsn#readme", "devDependencies": { - "eslint": ">=4", + "eslint": ">=6", "eslint-plugin-haraka": "*", "haraka-constants": "*", "mocha": "*"