This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
134 lines (114 loc) · 3.77 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Test Matrix
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: "${{ github.event_name == 'pull_request' }}"
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-13, 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
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: 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=1
working-directory: ./build
env:
ULX_DATA_DIR: .data-test
NODE_ENV: test
ULX_DEFAULT_BROWSER_ID: ${{ matrix.browser }}
NODE_OPTIONS: --max-old-space-size=4096
- 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@v4
with:
name: test-logs-${{matrix.os}}-${{ matrix.node-version }}-${{matrix.browser || 'main'}}
path: build/test-logs.tar
retention-days: 1