-
Notifications
You must be signed in to change notification settings - Fork 27
141 lines (141 loc) · 4.79 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
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
---
name: build
'on':
push:
pull_request:
permissions:
packages: write
env:
COREPACK_INTEGRITY_KEYS: 0
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/setup-node@v4
with:
node-version: 22
- id: deps
name: Install dependencies
run: |
docs/ndndpdk-depends.sh -y --node=0 --go=0 --dpdk=0 --spdk=0
echo meson=$(meson --version) >>$GITHUB_OUTPUT
sudo update-alternatives --install /usr/bin/go go $(command -v go) 1
- name: Cache DPDK and SPDK
uses: actions/cache@v4
with:
path: ~/setup-dpdk
key: ${{ steps.deps.outputs.meson }}_20250207
- uses: yoursunny/setup-dpdk@main
with:
dpdk-version: 84339a739845272045ce2a5e077def38c0a2170a
spdk-version: v25.01-rc1
- name: Build NDN-DPDK in debug mode
run: |
corepack pnpm install
make
sudo make install
for D in sample/activate sample/benchmark sample/status; do
pushd $D
corepack pnpm install
popd
done
sudo make uninstall
env:
NDNDPDK_MK_THREADSLEEP: 1
- name: Run required unit tests
run: |
echo 'bdev|disk|ethface|fetch|fileserver|fwdp|memifface|memiftransport|tgconsumer|tgproducer' >~/acceptable-failures.txt
MK_GOTEST_FILTER="/$(cat ~/acceptable-failures.txt)/ d" make test
env:
NDNDPDK_MK_THREADSLEEP: 1
- name: Run optional unit tests
run: |
MK_GOTEST_FILTER="/$(cat ~/acceptable-failures.txt)/! d" make test
env:
NDNDPDK_MK_THREADSLEEP: 1
continue-on-error: true
- name: Check code style
run: |
make lint
git diff --exit-code
- name: Build docs
run: make doxygen
- name: Build docs site
run: mk/netlify.sh
if: ${{ github.repository == 'yoursunny/ndn-dpdk' && github.event_name == 'push' }}
- name: Deploy docs site
uses: nwtgck/actions-netlify@v3
with:
publish-dir: ./build/netlify/
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.sha }} ${{ github.run_id }}
enable-pull-request-comment: false
enable-commit-comment: false
enable-commit-status: false
enable-github-deployment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: a0fbfa66-eecb-46d0-9e0b-093ddd1d0fad
if: ${{ github.repository == 'yoursunny/ndn-dpdk' && github.event_name == 'push' }}
docker:
runs-on: ubuntu-22.04
steps:
- id: prepare
name: Prepare build
run: |
echo tag=ghcr.io/${{ github.repository_owner }}/ndn-dpdk >>$GITHUB_OUTPUT
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'push' }}
- uses: docker/build-push-action@v6
with:
tags: ${{ steps.prepare.outputs.tag }}
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
APT_PKGS=libibverbs-dev
DEPENDS_ARGS=--arch=x86-64-v3 --dpdk-opts={"disable_drivers":"common/cnxk,common/dpaax,net/bnxt"}
MAKE_ENV=GOAMD64=v3 NDNDPDK_MK_RELEASE=1
push: ${{ github.event_name == 'push' }}
- name: Show image size
run: docker image inspect -f '{{.Size}}' ${{ steps.prepare.outputs.tag }}
- name: List files in image
run: docker run --rm ${{ steps.prepare.outputs.tag }} find /usr/local
library:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install TinyGo
run: |
wget -nv https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_amd64.deb
sudo dpkg -i tinygo_${TINYGO_VERSION}_amd64.deb
working-directory: /tmp
env:
TINYGO_VERSION: "0.35.0"
- name: Build for Linux without cgo
run: |
go build -v -o /dev/null ./ndn/...
go build -v -o /dev/null ./cmd/ndndpdk-ctrl
go build -v -o /dev/null ./cmd/ndndpdk-godemo
env:
CGO_ENABLED: 0
- name: Build for Windows without cgo
run: |
go build -v -o /dev/null ./ndn/...
env:
CGO_ENABLED: 0
GOOS: windows
- name: Build with TinyGo
run: |
tinygo build -o /dev/null -target=wasm ./ndn/ndntestenv/tiny
make -C sample/wasm