-
-
Notifications
You must be signed in to change notification settings - Fork 44
101 lines (83 loc) · 2.72 KB
/
lint-and-test.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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-13, windows-latest, ubuntu-latest]
node-version: [18, 20]
include:
- node-version: 20.x
os: ubuntu-latest
browser: chrome-125-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-120-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-115-0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- 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: Build modules
run: yarn build
- 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=1 --forceExit
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