Skip to content

Commit

Permalink
Merge pull request #483 from eXamadeus/ci/convert-travis-to-gha
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Feb 8, 2021
2 parents c37c9e2 + 9c1ad2b commit d889c32
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 18 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build-and-test-types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI
on: [push, pull_request]
jobs:
build:
name: Lint, Test, Report Coverage on Node ${{ matrix.node }}

runs-on: ubuntu-latest
strategy:
matrix:
node: ['10.x', '12.x', '14.x', '15.x']

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- uses: c-hive/gha-npm-cache@v1

- name: Install deps
run: npm ci --ignore-scripts

- name: Run linter
run: npm run lint

- name: Run tests
run: npm test

- name: Generate test coverage
run: npm run test:cov

- name: Compile
run: npm run compile

- name: Report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Report to Codecov.io
uses: codecov/codecov-action@v1
with:
files: ./coverage/lcov.info

test-types:
name: Test Types with TypeScript ${{ matrix.ts }}

needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['14.x']
ts: ['2.9', '3.0']
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- uses: c-hive/gha-npm-cache@v1

- name: Install deps
run: npm ci --ignore-scripts

- name: Install TypeScript ${{ matrix.ts }}
run: npm install typescript@${{ matrix.ts }} --ignore-scripts

- name: Test types
run: |
./node_modules/.bin/tsc --version
npm run test:typescript
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: no # [yes :: must have a head report to post]
2 changes: 1 addition & 1 deletion typescript_test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,4 @@ function testDynamicArrayArgument() {
s({}, 'val2');
// typings:expect-error
s({}, 'val3');
}
}

0 comments on commit d889c32

Please sign in to comment.