forked from node-pcap/node_pcap
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.72 KB
/
build.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
name: Build & Test
on: [push, pull_request]
jobs:
build-and-test:
name: ${{ matrix.os }} / Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
node: [ 18, 20, 22 ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies on Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libpcap-dev
shell: bash
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew update
brew install libpcap
shell: bash
- name: Add msbuild to PATH
if: matrix.os == 'windows'
uses: microsoft/[email protected]
- name: Install node-gyp
if: matrix.os == 'windows-latest'
run: |
npm install --global node-gyp@latest
- name: Build
run: |
npm install --build-from-source
- name: Test
if: matrix.os != 'windows-latest'
run: |
npm test
timeout-minutes: 1
build-and-test-alpine:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 18, 20, 22 ]
fail-fast: false
container: node:${{ matrix.node }}-alpine
steps:
- uses: actions/checkout@v4
- name: install build deps
run: |
apk add g++ libpcap-dev make python3
- name: Build
run: |
npm install --build-from-source
- name: Test
run: |
npm test
timeout-minutes: 1