Skip to content

Commit cb68096

Browse files
committed
ci: migrate to GitHub Actions w/ matrix (#84)
backport of 514dec0 - plus some `package.json#scripts` - and remove the typechecking from the CI workflow since the v1.0.x line is pre-TS * ci: migrate to GitHub Actions w/ matrix - Travis CI is only _pseudo_-free after the .org -> .com merge - c.f. https://travis-ci.community/t/org-com-migration-unexpectedly-comes-with-a-plan-change-for-oss-what-exactly-is-the-new-deal/10567 - and honestly, has glitches occasionally where my builds don't run or I can't manually re-run either - GH Actions are _actually_ free for OSS / public repos - and also offer a decent level of composability that's resulted in a huge surge in reusable community Actions (vs. CircleCI orbs etc haven't had nearly as much adoption) - and I've had a mostly great experience on them so far as well - also add a matrix for all Node LTS and all OSes - and upgrade to the Codecov GH Action, since the bash uploader was deprecated (https://about.codecov.io/blog/introducing-codecovs-new-uploader/) - this is basically a mix of the Actions I helped set-up in rpt2's repo and the TSDX templates: - https://github.com/ezolenko/rollup-plugin-typescript2/blob/03cfb048adcf39de56bd4566dc9a7300534a3cc1/.github/workflows/nodejs.yml - https://github.com/jaredpalmer/tsdx/blob/2d7981b00b2bf7363a3eeff44ff5ff698ba58c8c/templates/basic/.github/workflows/main.yml - plus upgrades to all the Actions, for instance, newer `setup-node` now has caching built-in * fix(ci): remove Node 18 due to node-canvas installation issues - per the in-line comment, there are some upstream issues in node-canvas that is causing installation to fail on Node 18 - made a TODO to add Node 18 back to the matrix once it's properly supported upstream * env: reorganize `package.json#scripts` - need `test:coverage` for the CI workflow - add other scripts from `main` branch - and reorder scripts to be the same as `main` as well
1 parent 6cf7aec commit cb68096

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
ci:
5+
name: CI - Node ${{ matrix.node-version }}, ${{ matrix.os }}
6+
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
# TODO: add back Node 18 once node-canvas is properly supported: https://github.com/Automattic/node-canvas/issues/2025
11+
node-version: [14.x, 16.x] # LTS Node: https://nodejs.org/en/about/releases/
12+
os: [ubuntu-latest, windows-latest, macOS-latest]
13+
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v3
17+
- name: Setup Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: 'npm'
22+
- name: Install
23+
run: npm ci
24+
25+
- name: Lint
26+
run: npm run lint
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Test w/ coverage report
31+
run: npm run test:coverage
32+
- name: Upload coverage report to Codecov
33+
uses: codecov/codecov-action@v2

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@
3535
"react-signature-pad"
3636
],
3737
"scripts": {
38-
"lint": "standard --parser babel-eslint",
39-
"lint:fix": "standard --parser babel-eslint --fix",
4038
"start": "webpack-dev-server -d --inline --hot",
39+
"clean": "rm -rf dist/ && rm -f *.tgz",
40+
"clean:build": "npm run clean && npm run build",
4141
"build": "webpack -p --config webpack.production.config.js",
42+
"lint": "standard --parser babel-eslint",
43+
"lint:fix": "standard --parser babel-eslint --fix",
4244
"test": "jest",
45+
"test:coverage": "jest --coverage",
46+
"test:watch": "jest --watch",
4347
"test:pub": "npm run build && npm pack",
4448
"pub": "npm run build && npm publish",
4549
"changelog": "changelog-maker"

0 commit comments

Comments
 (0)