Skip to content

Commit

Permalink
ci: migrate to GH actions
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
agilgur5 committed Jul 13, 2023
1 parent ae86acc commit def64c8
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 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:
node-version: [16.x, 18.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
# TODO: add when ts-standard linting is configured
# - 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
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![dw](https://img.shields.io/npm/dw/mst-persist.svg)](https://npmjs.org/package/mst-persist)
<br><!-- status / activity -->
[![typings](https://img.shields.io/npm/types/mst-persist.svg)](https://github.com/agilgur5/mst-persist/blob/master/src/index.ts)
[![build status](https://img.shields.io/travis/agilgur5/mst-persist/master.svg)](https://travis-ci.org/agilgur5/mst-persist)
[![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)
[![code coverage](https://img.shields.io/codecov/c/gh/agilgur5/mst-persist/master.svg)](https://codecov.io/gh/agilgur5/mst-persist)
<br>
[![NPM](https://nodei.co/npm/mst-persist.png?downloads=true&downloadRank=true&stars=true)](https://npmjs.org/package/mst-persist)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"tsc": "tsc --noEmit",
"test": "tsdx test",
"test:coverage": "tsdx test --coverage",
"test:pub": "npm run build && npm pack",
"pub": "npm run build && npm publish",
"changelog": "changelog-maker"
Expand Down

0 comments on commit def64c8

Please sign in to comment.