2019-09-24 11:53:50 +02:00
|
|
|
name: Tests
|
2019-08-08 18:40:26 +02:00
|
|
|
on: [push, pull_request]
|
2019-10-08 07:47:40 +02:00
|
|
|
env:
|
|
|
|
CI: true
|
2019-08-08 18:40:26 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
name: Node ${{ matrix.node }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
2019-08-24 01:32:29 +02:00
|
|
|
fail-fast: false
|
2019-08-08 18:40:26 +02:00
|
|
|
matrix:
|
2019-10-09 10:11:37 +02:00
|
|
|
node: [10, 12]
|
2019-08-08 18:40:26 +02:00
|
|
|
|
|
|
|
steps:
|
2019-08-24 01:32:29 +02:00
|
|
|
- name: Clone repository
|
2019-12-13 14:59:37 +01:00
|
|
|
uses: actions/checkout@v2
|
2019-08-09 17:28:41 +02:00
|
|
|
|
|
|
|
- name: Set Node.js version
|
2019-09-16 14:28:25 +02:00
|
|
|
uses: actions/setup-node@v1
|
2019-08-09 17:28:41 +02:00
|
|
|
with:
|
2019-09-16 14:28:25 +02:00
|
|
|
node-version: ${{ matrix.node }}
|
2019-08-09 17:28:41 +02:00
|
|
|
|
|
|
|
- run: java -version
|
|
|
|
|
2019-12-13 16:12:03 +01:00
|
|
|
- name: Set up npm cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2019-12-24 17:12:13 +01:00
|
|
|
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/test.yml') }}
|
2019-12-13 16:12:03 +01:00
|
|
|
restore-keys: |
|
2019-12-24 17:12:13 +01:00
|
|
|
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/test.yml') }}
|
|
|
|
${{ runner.OS }}-node-v${{ matrix.node }}-
|
2019-12-13 16:12:03 +01:00
|
|
|
|
2019-08-09 17:28:41 +02:00
|
|
|
- name: Install npm dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: npm test
|
|
|
|
|
2020-04-08 20:28:54 +02:00
|
|
|
- name: Run bundlewatch
|
|
|
|
run: npm run bundlewatch
|
2019-08-24 01:32:29 +02:00
|
|
|
if: matrix.node == 10
|
2019-08-09 17:28:41 +02:00
|
|
|
env:
|
2020-04-08 20:28:54 +02:00
|
|
|
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
|
2019-08-09 17:28:41 +02:00
|
|
|
|
|
|
|
- name: Run BrowserStack tests
|
|
|
|
run: npm run js-test-cloud
|
|
|
|
if: matrix.node == 10 && github.repository == 'twbs/bootstrap' && github.event_name == 'push'
|
|
|
|
env:
|
|
|
|
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
|
|
|
|
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"
|
|
|
|
|
|
|
|
- name: Run Coveralls
|
2019-11-18 20:03:43 +01:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
if: matrix.node == 10
|
|
|
|
with:
|
|
|
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
path-to-lcov: "./js/coverage/lcov.info"
|