Skip to content

Commit

Permalink
ci: migrate to GitHub Actions w/ matrix (#84)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
agilgur5 authored Jun 11, 2022
1 parent 3db849f commit 514dec0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI
on: [push]
jobs:
ci:
name: CI - Node ${{ matrix.node-version }}, ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
# TODO: add back Node 18 once node-canvas is properly supported: https://github.com/Automattic/node-canvas/issues/2025
node-version: [14.x, 16.x] # LTS Node: https://nodejs.org/en/about/releases/
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm ci

- name: Typecheck
run: npm run tsc
- name: Lint
run: npm run lint
- name: Build
run: npm run build

- name: Test w/ coverage report
run: npm run test:coverage
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

0 comments on commit 514dec0

Please sign in to comment.