Skip to content

Electron mocha renderer migration #1974

Electron mocha renderer migration

Electron mocha renderer migration #1974

Workflow file for this run

name: PR Checks
on:
push:
branches:
- main
pull_request:
jobs:
'Checking':
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Ubuntu is not ubuntu-latest as that is causing hangs in the CI
os: [macos-latest, ubuntu-20.04, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: ' Startup ChromeDriver and Display in Ubuntu'
shell: bash
if: matrix.os == 'ubuntu-20.04'
run: |
export DISPLAY=:99
# TODO: need to download driver according to electron's version
wget --directory-prefix=/tmp https://chromedriver.storage.googleapis.com/100.0.4896.20/chromedriver_linux64.zip
unzip -d /tmp/chromedriver /tmp/chromedriver_linux64.zip
sudo chmod +x /tmp/chromedriver/chromedriver
/tmp/chromedriver/chromedriver &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: ' Install Dependencies'
shell: bash
run: |
npm install
- name: ' Lint'
shell: bash
run: |
npm run lint
- name: ' Tests'
shell: bash
env:
OS: ${{ matrix.os }}
run: |
if [[ $OS == 'ubuntu-20.04' ]]; then
# Avoid "failed to connect to the bus" errors on CI https://github.com/microsoft/WSL/issues/7915
export XDG_RUNTIME_DIR=/run/user/$(id -u)
sudo mkdir -p $XDG_RUNTIME_DIR
sudo chmod 700 $XDG_RUNTIME_DIR
sudo chown $(id -un):$(id -gn) $XDG_RUNTIME_DIR
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
# For ChromeDriver to work
export DISPLAY=':99'
fi
npm run test:electron-mocha-main
# Move initial coverage to avoid it being replaced below by renderer run
mv coverage_c8 coverage-electron-mocha-main
npm run test:electron-mocha-renderer
npm run test:jest
npm run test:mocha
- name: ' CodeCov'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-electron-mocha-main/coverage-final.json,coverage_c8/coverage-final.json,coverage_jest/coverage-final.json,coverage_mocha/coverage-final.json
name: codecov-${{ matrix.os }}
verbose: true