forked from darkreader/darkreader
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.08 KB
/
test-browser.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Run browser tests in Karma
on:
# Runs for pushes and pull requests,
# but don't run these when only some config is changed.
push:
branches:
- main
paths-ignore:
- 'src/config/*'
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
paths-ignore:
- 'src/config/**'
workflow_dispatch:
jobs:
test-browser:
name: Run browser tests
strategy:
matrix:
include:
# Extended support releases
- channel: esr
firefox: latest-esr
# Stable releases
- channel: stable
chrome: stable
firefox: latest
coverage: true
# Beta releases
- channel: beta
chrome: beta
firefox: latest-beta
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install Chrome
if: ${{ matrix.chrome }}
uses: browser-actions/setup-chrome@latest
with:
chrome-version: ${{ matrix.chrome }}
- name: Configure Karma with path to Chrome executable
if: ${{ matrix.chrome }}
run: |
chrome --version
{ echo CHROME_BIN="$(which chrome)"; echo CHROME_TEST=1; } | tee -a "$GITHUB_ENV"
- name: Install Firefox
if: ${{ matrix.firefox }}
uses: browser-actions/setup-firefox@latest
with:
firefox-version: ${{ matrix.firefox }}
- name: Configure Karma with path to Firefox executable
if: ${{ matrix.firefox }}
run: |
firefox --version
{ echo FIREFOX_BIN="$(which firefox)"; echo FIREFOX_TEST=1; } | tee -a "$GITHUB_ENV"
- name: Node.js setup
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Track Node and NPM version
run: node --version && npm --version
- name: Install application dependencies
run: npm ci
- name: Run tests
run: npm run test:inject -- --ci