Skip to content

Commit def64c8

Browse files
committed
ci: migrate to GH actions
- mostly duplicate what I have in [react-signature-canvas](https://github.com/agilgur5/react-signature-canvas/blob/main/.github/workflows/ci.yml) - update LTS Node versions to 18.x and 20.x - comment out linting step for now as `ts-standard` hasn't been configured in this repo - add `tsc` and `test:coverage` scripts for CI - had to specify `--noEmit` for now, the whole build system will need to be revamped later - replace Travis badge with GH Actions badge
1 parent ae86acc commit def64c8

File tree

4 files changed

+38
-10
lines changed

4 files changed

+38
-10
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
node-version: [16.x, 18.x] # LTS Node: https://nodejs.org/en/about/releases/
11+
os: [ubuntu-latest, windows-latest, macOS-latest]
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
- name: Setup Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
cache: 'npm'
21+
- name: Install
22+
run: npm ci
23+
24+
- name: Typecheck
25+
run: npm run tsc
26+
# TODO: add when ts-standard linting is configured
27+
# - name: Lint
28+
# run: npm run lint
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Test w/ coverage report
33+
run: npm run test:coverage
34+
- name: Upload coverage report to Codecov
35+
uses: codecov/codecov-action@v2

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![dw](https://img.shields.io/npm/dw/mst-persist.svg)](https://npmjs.org/package/mst-persist)
1212
<br><!-- status / activity -->
1313
[![typings](https://img.shields.io/npm/types/mst-persist.svg)](https://github.com/agilgur5/mst-persist/blob/master/src/index.ts)
14-
[![build status](https://img.shields.io/travis/agilgur5/mst-persist/master.svg)](https://travis-ci.org/agilgur5/mst-persist)
14+
[![build status](https://img.shields.io/github/actions/workflow/status/agilgur5/mst-persist/ci.yml?branch=main)](https://github.com/agilgur5/mst-persist/actions/workflows/ci.yml?query=branch%3Amain)
1515
[![code coverage](https://img.shields.io/codecov/c/gh/agilgur5/mst-persist/master.svg)](https://codecov.io/gh/agilgur5/mst-persist)
1616
<br>
1717
[![NPM](https://nodei.co/npm/mst-persist.png?downloads=true&downloadRank=true&stars=true)](https://npmjs.org/package/mst-persist)

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"scripts": {
3030
"start": "tsdx watch",
3131
"build": "tsdx build",
32+
"tsc": "tsc --noEmit",
3233
"test": "tsdx test",
34+
"test:coverage": "tsdx test --coverage",
3335
"test:pub": "npm run build && npm pack",
3436
"pub": "npm run build && npm publish",
3537
"changelog": "changelog-maker"

0 commit comments

Comments
 (0)