Skip to content

Commit bb79a44

Browse files
committedAug 1, 2022
ci: migrate from Travis to GH actions
1 parent 5faed4c commit bb79a44

File tree

5 files changed

+80
-40
lines changed

5 files changed

+80
-40
lines changed
 

‎.github/workflows/gitter.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
on: create
2+
3+
jobs:
4+
notify:
5+
if: github.ref_type == 'tag'
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- run: curl --data-urlencode "message=[${{github.repository}} ${{github.ref_name}}](https://github.com/${{github.repository}}/releases/${{github.ref_name}}) released" ${{secrets.GITTER_CUSTOM_WEBHOOK}}

‎.github/workflows/test.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: ['**']
5+
pull_request:
6+
branches: ['master']
7+
8+
jobs:
9+
pre-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
cache: 'npm'
16+
17+
- run: npm install
18+
- run: npm run format:check
19+
- run: npm run lint:check
20+
21+
branch-test:
22+
if: github.ref_name != 'master' && success()
23+
needs: pre-test
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
os: ['ubuntu-latest', 'windows-latest']
28+
node: ['12.0']
29+
name: Testing Node ${{ matrix.node }} on ${{ matrix.os }}
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-node@v2
33+
with:
34+
cache: 'npm'
35+
36+
- run: npm install
37+
- run: npm test
38+
39+
test:
40+
if: github.ref_name == 'master' && success()
41+
needs: pre-test
42+
runs-on: ${{ matrix.os }}
43+
strategy:
44+
matrix:
45+
os: ['ubuntu-latest', 'windows-latest']
46+
node: ['12.0', '14.0', '16.0']
47+
name: Testing Node ${{ matrix.node }} on ${{ matrix.os }}
48+
steps:
49+
- uses: actions/checkout@v2
50+
- uses: actions/setup-node@v2
51+
with:
52+
node-version: ${{ matrix.node }}
53+
cache: 'npm'
54+
55+
- run: npm install
56+
- run: npm test
57+
- if: matrix.os == 'ubuntu-latest' && matrix.node == '16.0'
58+
run: npm run coverage
59+
- if: matrix.os == 'ubuntu-latest' && matrix.node == '16.0'
60+
uses: coverallsapp/github-action@v1.1.2
61+
with:
62+
github-token: ${{ github.token }}
63+
path-to-lcov: ./coverage.info

‎.travis.yml

-36
This file was deleted.

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ To use this plugin with the Metalsmith CLI, add `@metalsmith/permalinks` to the
344344
345345
[npm-badge]: https://img.shields.io/npm/v/@metalsmith/permalinks.svg
346346
[npm-url]: https://www.npmjs.com/package/@metalsmith/permalinks
347-
[ci-badge]: https://app.travis-ci.com/metalsmith/permalinks.svg?branch=master
348-
[ci-url]: https://app.travis-ci.com/github/metalsmith/permalinks
347+
[ci-badge]: https://github.com/metalsmith/permalinks/actions/workflows/test.yml/badge.svg
348+
[ci-url]: https://github.com/metalsmith/permalinks/actions/workflows/test.yml
349349
[metalsmith-badge]: https://img.shields.io/badge/metalsmith-plugin-green.svg?longCache=true
350350
[metalsmith-url]: https://metalsmith.io/
351351
[codecov-badge]: https://img.shields.io/coveralls/github/metalsmith/permalinks

‎package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"url": "https://github.com/metalsmith/permalinks/issues"
1313
},
1414
"author": "Ian Storm Taylor (https://ianstormtaylor.com)",
15+
"contributors": [
16+
"Kevin Van Lierde (https://webketje.com)"
17+
],
1518
"repository": {
1619
"type": "git",
1720
"url": "https://github.com/metalsmith/permalinks.git"
@@ -22,9 +25,10 @@
2225
"scripts": {
2326
"changelog": "auto-changelog -u --starting-date 2021-05-01 --commit-limit false --ignore-commit-pattern '(dev|Release|Merge)'",
2427
"coverage": "nyc report --reporter=text-lcov > ./coverage.info",
25-
"coveralls": "npm run coverage && cat ./coverage.info | coveralls",
2628
"format": "prettier --write \"**/*.{yml,md,js,json}\"",
27-
"lint": "eslint --cache --fix-dry-run \"**/*.js\"",
29+
"format:check": "prettier --list-different \"**/*.{yml,md,js,json}\"",
30+
"lint": "eslint --fix .",
31+
"lint:check": "eslint --fix-dry-run .",
2832
"dev": "nodemon --exec \"npm run lint && npm test\"",
2933
"test": "nyc mocha",
3034
"release": "release-it ."

0 commit comments

Comments
 (0)
Please sign in to comment.