Skip to content

Workflow file for this run

name: Test Matrix
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
workflow_dispatch:
jobs:
lint-and-test:
name: Test node-${{ matrix.node-version }}, ${{ matrix.os }}, ${{matrix.browser || 'latest'}}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [16,18,20]
include:
- node-version: 18.x
os: ubuntu-latest
browser: chrome-113-0
- node-version: 18.x
os: ubuntu-latest
browser: chrome-111-0
- node-version: 18.x
os: ubuntu-latest
browser: chrome-109-0
- node-version: 18.x
os: ubuntu-latest
browser: chrome-103-0
- node-version: 18.x
os: ubuntu-latest
browser: chrome-97-0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install pcap
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y libpcap-dev
- name: Chocolatey Install Action
if: ${{ matrix.os == 'windows-latest' }}
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install python2 visualcpp-build-tools -y
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: ${{ matrix.os == 'windows-latest' }}
- name: Clone ulixee/shared
run: git clone https://github.com/ulixee/shared.git
working-directory: ..
- name: Install ulixee/shared
run: yarn build
working-directory: ../shared
- name: Yarn build
run: yarn build
env:
ULX_MITM_REBUILD_SOCKET: 1
- name: Linux - Add Chrome Env
if: ${{ matrix.browser }}
working-directory: ./build
run: yarn add -W @ulixee/${{ matrix.browser }}
- name: Linux - Apt Install Chrome(s)
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: ./build
run: sudo $(npx install-browser-deps)
- name: Run Lint
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 18 }}
run: NODE_OPTIONS=--max-old-space-size=4096 yarn lint
- name: Run tests
run: yarn jest --testTimeout=60000 --maxWorkers=2
working-directory: ./build
env:
ULX_DATA_DIR: .data-test
NODE_ENV: test
ULX_DEFAULT_BROWSER_ID: ${{ matrix.browser }}
- name: 'Tar files'
if: ${{ failure() }}
working-directory: ./build
run: tar -cvf test-logs.tar .data-test
- name: Upload Databases
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: test-logs-${{matrix.os}}-${{ matrix.node-version }}-${{matrix.browser || 'main'}}
path: build/test-logs.tar
retention-days: 1