-
Notifications
You must be signed in to change notification settings - Fork 57
165 lines (144 loc) · 4.73 KB
/
msys2_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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Windows MSYS2 build
on:
push:
branches:
- main
- 'maint-**'
pull_request:
branches:
- main
- 'maint-**'
workflow_call:
env:
# FIXME: For some reason enabling jit debugging "fixes" random python crashes
# see https://github.com/msys2/MINGW-packages/issues/11864 and
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3280#note_1678973
MSYS: winjitdebug
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changed: ${{ steps.filter.outputs.src == 'true' || steps.filter.outputs.build == 'true' }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2
id: filter
with:
filters: .github/path_filters.yml
build:
needs: changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sys:
- mingw64
- ucrt64
dpdk: [23.07, 23.03]
defaults:
run:
shell: msys2 {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- name: Install dependencies
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff # v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >-
git
base-devel
unzip
pacboy: >-
pkgconf:p
openssl:p
gcc:p
meson:p
json-c:p
libpcap:p
gtest:p
SDL2:p
SDL2_ttf:p
dlfcn:p
- name: Install npcap-sdk
run: |
wget https://nmap.org/npcap/dist/npcap-sdk-1.12.zip
unzip -d npcap-sdk npcap-sdk-1.12.zip
cp npcap-sdk/Lib/x64/* ${MSYSTEM_PREFIX}/lib/
- name: Checkout IMTL code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Checkout mman-win32 code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
repository: 'alitrack/mman-win32'
ref: master
path: mman-win32
- name: Build and install mman-win32
run: |
cd mman-win32
./configure --prefix=${MSYSTEM_PREFIX}
make -j$(nproc) && make install
- name: Convert patches for DPDK
run: |
cd patches/dpdk/${{matrix.dpdk}}
ls *.patch | xargs -I{} bash -c 'if [[ $(sed -n '1p' "{}") =~ ^../.*\.patch$ ]]; then cp "$(cat "{}")" "{}"; fi'
cd windows
ls *.patch | xargs -I{} bash -c 'if [[ $(sed -n '1p' "{}") =~ ^../.*\.patch$ ]]; then cp "$(cat "{}")" "{}"; fi'
- name: Hash DPDK patches
id: hash-patches
run: |
HASH=$(sha1sum patches/dpdk/${{matrix.dpdk}}/*.patch patches/dpdk/${{matrix.dpdk}}/windows/*.patch | sha1sum | cut -d" " -f1)
echo "hash=${HASH}" >> $GITHUB_OUTPUT
- name: Cache DPDK
id: cache-dpdk
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: dpdk
key: dpdk-${{ matrix.dpdk }}-${{ matrix.sys }}-${{ steps.hash-patches.outputs.hash }}
- name: Checkout DPDK code
if: ${{ steps.cache-dpdk.outputs.cache-hit != 'true' }}
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
repository: 'DPDK/dpdk'
ref: v${{matrix.dpdk}}
path: dpdk
clean: true
- name: Apply patches for DPDK
if: ${{ steps.cache-dpdk.outputs.cache-hit != 'true' }}
shell: bash
run: |
cd dpdk
git config user.name github-actions
git config user.email [email protected]
git am ../patches/dpdk/${{matrix.dpdk}}/*.patch
git am ../patches/dpdk/${{matrix.dpdk}}/windows/*.patch
- name: Build and install DPDK
if: ${{ steps.cache-dpdk.outputs.cache-hit != 'true' }}
run: |
cd dpdk
meson setup build -Dplatform=generic
meson install -C build
- name: Install cached DPDK
if: ${{ steps.cache-dpdk.outputs.cache-hit == 'true' }}
run: |
cd dpdk
meson install -C build --no-rebuild
- name: Build
run: |
./build.sh
- name: Build with debug
run: |
rm build -rf
./build.sh debugonly
- name: Build with TAP
run: |
meson setup tap_build -Denable_tap=true
meson install -C tap_build