Skip to content

Add support for LTS #251

Add support for LTS

Add support for LTS #251

Workflow file for this run

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
with:
run: npm run test:units -- react ${{ env.REACT_VERSION }}
# Runs E2E tests for all configured React version and all environments
test-e2e:
runs-on: ubuntu-20.04
name: Run E2E tests
strategy:
matrix:
browser: [chrome, firefox, edge, safari]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
# Set variables required for further steps.
# REACT_VERSION is set to "current" for pull request events and "all" for other events.
# BUILD_SLUG is a combination of repo name and short SHA.
- name: Set test variables
run: |
echo "BUILD_SLUG=$(echo $GITHUB_REPOSITORY | cut -d '/' -f2) $(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV;
if [ -z ${GITHUB_HEAD_REF} ]; then echo "REACT_VERSION=last-two"; 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:
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
BROWSER_STACK_BUILD_NAME: ${{ env.BUILD_SLUG }}
BROWSER_STACK_BROWSER: ${{ matrix.browser }}
CKEDITOR_LICENSE_KEY: ${{ secrets.CKEDITOR_LICENSE_KEY }}
with:
run: npm run test:e2e -- --react ${{ env.REACT_VERSION }}