Skip to content

Commit

Permalink
Add GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 22, 2020
1 parent 77a748f commit 6f3176a
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 39 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/workflow.yml
@@ -0,0 +1,69 @@
name: Build
on: [push, pull_request]
env:
# GitHub actions does not define this but should
CI: 'true'
jobs:
combinations:
# git push --tags does not create any commits so should not trigger a new
# workflow. There are no ways to skip workflows, so we skip jobs instead
if: toJson(github.event.commits) != '[]'
strategy:
# Test on Windows/Mac/Linux using latest Node.js.
# Also test on Linux with older Node.js versions.
# We do not run each possible combination to make CI faster.
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node: [10.17.0, 13]
exclude:
- os: macOS-latest
node: 10.17.0
- os: windows-latest
node: 10.17.0
fail-fast: false
runs-on: ${{ matrix.os }}
# We do not use @actions/cache because restoring/saving cache currently
# takes more time than the time saved on `npm ci`
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Linting
run: npx gulp check
- name: Build
run: npx gulp build
- name: Tests
run: npx gulp unit
- name: Upload test coverage
run: npx gulp uploadCoverage
# Performed after each OS + Node.js version combination has succeeded
final:
needs: combinations
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Node.js 13
uses: actions/setup-node@v1
with:
node-version: 13
- name: Install dependencies
run: npm ci
# Test coverage check must happen after tests for the whole matrix have been
# performed, so we get the merged coverage map
- name: Check test coverage
run: npx gulp checkCoverage
- name: Build
run: npx gulp build
- name: Deploy
if:
startsWith(github.event.head_commit.message, 'Release ') &&
github.event_name != 'pull_request'
run: npx gulp publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

0 comments on commit 6f3176a

Please sign in to comment.