Skip to content

chore: merge typescript, ghactions and build #838

chore: merge typescript, ghactions and build

chore: merge typescript, ghactions and build #838

Workflow file for this run

name: Test Matrix
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test ${{matrix.browser || 'chrome-latest' }} (node ${{ matrix.node-version }}; ${{ matrix.os }})
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [18, 20]
include:
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-123-0
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-122-0
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-121-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-120-0
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-119-0
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-118-0
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-117-0
# - node-version: 20.x
# os: ubuntu-latest
# browser: chrome-116-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-115-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-114-0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
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@v3
with:
args: install python2 visualcpp-build-tools -y
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
if: ${{ matrix.os == 'windows-latest' }}
- 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: Build modules
run: yarn build --network-timeout 1000000
env:
ULX_MITM_REBUILD_SOCKET: 1
- name: Run tests
run: yarn jest --testTimeout=60000 --maxWorkers=2
working-directory: ./build
env:
NODE_ENV: test
ULX_DATA_DIR: .data
ULX_DEFAULT_BROWSER_ID: ${{ matrix.browser }}
NODE_OPTIONS: --max-old-space-size=4096
- name: 'Tar files'
if: ${{ failure() }}
run: tar -cvf test-dbs.tar ./build/.data
- name: Upload Databases
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-dbs-${{matrix.os}}-${{ matrix.node-version }}-${{matrix.browser || 'main'}}
path: test-dbs.tar
retention-days: 1