Skip to content

Commit

Permalink
chore: switch from travis to github ci (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored Dec 4, 2020
1 parent 2d21afc commit cfee30b
Show file tree
Hide file tree
Showing 6 changed files with 3,016 additions and 2,157 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: ci

on: [push, pull_request]

jobs:
should-skip:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should-skip-job: ${{ steps.skip-check.outputs.should_skip }}
steps:
- id: skip-check
uses: fkirc/skip-duplicate-actions@v2.1.0
with:
github_token: ${{ github.token }}

ci:
needs: should-skip
if: ${{ needs.should-skip.outputs.should-skip-job != 'true'}}
env:
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
runs-on: ${{ matrix.os }}
strategy:
# TODO: test IE 11, Legacy Edge, and New Edge on windows-latest
# test Safari on macos-latest
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
shell: bash
id: nvm

- name: update apt cache on linux w/o browserstack
run: sudo apt-get update
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}

- name: Install ffmpeg/pulseaudio for firefox on linux w/o browserstack
run: sudo apt-get install ffmpeg pulseaudio
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}

- name: start pulseaudio for firefox on linux w/o browserstack
run: pulseaudio -D
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
# turn off the default setup-node problem watchers...
- run: echo "::remove-matcher owner=eslint-compact::"
- run: echo "::remove-matcher owner=eslint-stylish::"
- run: echo "::remove-matcher owner=tsc::"

- run: npm i --prefer-offline --no-audit

# run safari on macos
- name: Run Mac test
run: npm run test -- --browsers Safari
if: ${{ startsWith(matrix.os, 'macos') }}

# only run ie 11 on windows
- name: Run Windows test
run: npm run test -- --browsers IE
if: ${{ startsWith(matrix.os, 'windows') }}

# run chrome/firefox or browserstack in linux
- name: Run linux test
uses: GabrielBB/xvfb-action@v1
with:
run: npm test
if: ${{ startsWith(matrix.os, 'ubuntu') }}

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
10
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit cfee30b

Please sign in to comment.