2019-11-06 13:14:09 +01:00
|
|
|
name: CI
|
|
|
|
|
2019-12-03 23:52:39 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- "2.9"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- "2.9"
|
2021-04-04 15:39:48 +02:00
|
|
|
workflow_dispatch:
|
2022-06-13 16:25:56 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2019-11-06 13:14:09 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-06-13 16:25:56 +02:00
|
|
|
permissions:
|
|
|
|
checks: write # for coverallsapp/github-action to create new checks
|
|
|
|
contents: read # for dorny/paths-filter to fetch a list of changed files
|
|
|
|
pull-requests: read # for dorny/paths-filter to read pull requests
|
2019-11-06 13:14:09 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2020-12-05 16:57:19 +01:00
|
|
|
outputs:
|
|
|
|
coveralls: ${{ steps.changes.outputs.src }}
|
|
|
|
|
2019-11-06 13:14:09 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-12-03 23:52:39 +01:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2019-11-06 13:14:09 +01:00
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
2023-09-14 15:20:57 +02:00
|
|
|
- uses: actions/checkout@v4
|
2024-05-13 14:29:49 +02:00
|
|
|
- uses: pnpm/action-setup@v4.0.0
|
2021-10-16 21:18:11 +02:00
|
|
|
- name: Use Node.js
|
2023-10-30 13:08:16 +01:00
|
|
|
uses: actions/setup-node@v4
|
2021-10-16 21:18:11 +02:00
|
|
|
with:
|
2023-09-14 15:41:54 +02:00
|
|
|
node-version: 16
|
2022-08-22 20:42:43 +02:00
|
|
|
cache: pnpm
|
2024-02-04 19:43:48 +01:00
|
|
|
- uses: dorny/paths-filter@v3
|
2021-10-16 21:18:11 +02:00
|
|
|
id: changes
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
docs:
|
|
|
|
- 'docs/**'
|
|
|
|
- 'package.json'
|
|
|
|
- 'tsconfig.json'
|
|
|
|
src:
|
|
|
|
- 'src/**'
|
|
|
|
- 'package.json'
|
|
|
|
test:
|
|
|
|
- 'test/**'
|
|
|
|
- 'karma.conf.js'
|
|
|
|
- 'package.json'
|
|
|
|
types:
|
|
|
|
- 'package.json'
|
|
|
|
- 'tsconfig.json'
|
|
|
|
- name: Install
|
2022-08-22 20:42:43 +02:00
|
|
|
run: pnpm install
|
2022-07-07 13:15:54 +02:00
|
|
|
- name: Lint
|
2022-08-22 20:42:43 +02:00
|
|
|
run: pnpm run lint
|
2021-10-16 21:18:11 +02:00
|
|
|
- name: Build
|
2022-08-22 20:42:43 +02:00
|
|
|
run: pnpm run build
|
2021-10-16 21:18:11 +02:00
|
|
|
- name: Test
|
|
|
|
if: |
|
2022-05-08 19:19:41 +02:00
|
|
|
(steps.changes.outputs.src == 'true' ||
|
2022-12-16 13:56:06 +01:00
|
|
|
steps.changes.outputs.test == 'true') &&
|
2022-05-08 19:19:41 +02:00
|
|
|
runner.os != 'Windows'
|
2021-10-16 21:18:11 +02:00
|
|
|
run: |
|
2022-08-22 20:42:43 +02:00
|
|
|
pnpm run build
|
2022-05-08 19:19:41 +02:00
|
|
|
if [ "${{ runner.os }}" == "macOS" ]; then
|
2022-08-22 20:42:43 +02:00
|
|
|
pnpm run test-ci --browsers chrome,safari
|
2021-10-16 21:18:11 +02:00
|
|
|
else
|
2022-08-22 20:42:43 +02:00
|
|
|
xvfb-run --auto-servernum pnpm run test-ci
|
2021-10-16 21:18:11 +02:00
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
- name: Package
|
|
|
|
if: steps.changes.outputs.docs == 'true'
|
|
|
|
run: |
|
2022-08-22 20:42:43 +02:00
|
|
|
pnpm run docs
|
|
|
|
pnpm pack
|
2021-10-16 21:18:11 +02:00
|
|
|
- name: Coveralls Parallel - Chrome
|
2022-05-22 19:15:34 +02:00
|
|
|
if: |
|
|
|
|
steps.changes.outputs.src == 'true' &&
|
|
|
|
runner.os != 'Windows'
|
2021-10-16 21:18:11 +02:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
path-to-lcov: './coverage/chrome/lcov.info'
|
|
|
|
flag-name: ${{ matrix.os }}-chrome
|
|
|
|
parallel: true
|
|
|
|
- name: Coveralls Parallel - Firefox
|
2022-05-22 19:15:34 +02:00
|
|
|
if: |
|
|
|
|
steps.changes.outputs.src == 'true' &&
|
|
|
|
runner.os != 'Windows'
|
2021-10-16 21:18:11 +02:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
path-to-lcov: './coverage/firefox/lcov.info'
|
|
|
|
flag-name: ${{ matrix.os }}-firefox
|
|
|
|
parallel: true
|
2020-11-10 16:21:38 +01:00
|
|
|
|
|
|
|
finish:
|
2022-06-13 16:25:56 +02:00
|
|
|
permissions:
|
|
|
|
checks: write # for coverallsapp/github-action to create new checks
|
2020-11-10 16:21:38 +01:00
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-10-16 21:18:11 +02:00
|
|
|
- name: Coveralls Finished
|
|
|
|
if: needs.build.outputs.coveralls == 'true'
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel-finished: true
|