-
Notifications
You must be signed in to change notification settings - Fork 54
53 lines (46 loc) · 1.63 KB
/
test-all.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
name: Test all
on:
pull_request:
branches:
- master
- stable
- major
push:
tags:
- v*
branches:
- master
- stable
- major
jobs:
# Runs unit tests for all configured React version
test-units:
runs-on: ubuntu-20.04
name: Run unit tests
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
# Set variables required for further steps.
# CHROME_BIN is required by Karma.
# REACT_VERSION is set to "current" for pull request events and "all" for other events.
- name: Set test variables
run: |
export CHROME_BIN=$(which chrome);
if [ -z ${GITHUB_HEAD_REF} ]; then echo "REACT_VERSION=all"; else echo "REACT_VERSION=current"; fi >> $GITHUB_ENV;
- name: Install dependencies
run: npm install
# Run tests with the help of Xvfb, since there is no screen output available (required for locally installed browsers).
- name: Run tests
uses: GabrielBB/xvfb-action@v1
env:
CKEDITOR_LICENSE_KEY: ${{ secrets.CKEDITOR_LICENSE_KEY }}
with:
run: npm run test:units -- react ${{ env.REACT_VERSION }}