mathjs/.github/workflows/build.yaml
Harry Sarson 788c0b96e9
Refactor/GitHub workflow (#2041)
* Try out running unit tests with github actions instead of Travis

* try running browser tests in github actions

* fix workflow names

* run build on pr too

* trying running CI only once on PR

* Revert "trying running CI only once on PR"

This reverts commit 9a3db6e167642e9bd35ed6f20a459c5450dd882e.

* run CI only once on PR from branch

* try running transpiled build on node 10

* correct node version syntax + tidy

* fix syntax

* final (?) fix up

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-12-18 14:36:56 +01:00

83 lines
1.5 KiB
YAML

name: Node.js CI
on:
push:
branches:
- develop
- master
tags:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:src
env:
CI: true
test-on-node-10:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10.x
- run: npm ci
- run: npm run test:src -- --require @babel/register
env:
CI: true
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run lint
env:
CI: true
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run coverage && npx codecov
env:
CI: true
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run build-and-test
env:
CI: true