Skip to content

Commit

Permalink
Add Github actions
Browse files Browse the repository at this point in the history
This will replace travis-ci, which appears to no longer be free.
  • Loading branch information
badeball committed Jul 5, 2023
1 parent 18ddb3e commit a579487
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,35 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
karma: [4, 5, 6]
jsdom: [20, 21, 22]
name: Karma v${{ matrix.karma }} & jsdom v${{ matrix.jsdom }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: latest
- name: Cache NPM modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package.json') }}-${{ matrix.karma }}-${{ matrix.jsdom }}
restore-keys:
${{ runner.os }}-npm-${{ hashFiles('package.json') }}
${{ runner.os }}-npm-
- name: Dependencies
run: npm install
- name: Peer dependencies
run: npm install --no-save jsdom@${{ matrix.jsdom }} karma@${{ matrix.karma }}
- name: Link
run: "[ -e node_modules/karma-jsom-launcher ] || ln -s ../ node_modules/karma-jsom-launcher"
- name: Test
run: npm test

0 comments on commit a579487

Please sign in to comment.