-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (117 loc) · 4.61 KB
/
Copy pathci.yml
File metadata and controls
121 lines (117 loc) · 4.61 KB
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
name: CI
on:
push:
branches:
- "**"
- "!dependabot/**"
pull_request:
branches: [main]
workflow_call:
jobs:
nesquic:
name: Test Nesquic [${{ matrix.rust }}, ${{ matrix.profile }}}]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
rust: [stable, nightly]
profile: [dev, release]
exclude:
- rust: nightly
profile: release
# Anything nightly is treated as informational-only.
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- name: "Set environmental variables"
shell: bash
run: |
#RUST_BACKTRACE_nightly='1'
#CFLAGS_nightly='-fsanitize=leak'
#CXXFLAGS_nightly='-fsanitize=leak'
#RUSTFLAGS_nightly='-Zsanitizer=leak'
# A function for defining a variable conditional on the toolchain in
# use.
tc_var() {
# Replace any dots in the toolchain name with underscores. Necessary
# due to shell imposed variable naming restrictions.
var="${1}_$(echo ${{ matrix.rust }} | tr . _)"
echo "${1}=${!var}" >> ${GITHUB_ENV}
}
tc_var RUST_BACKTRACE
tc_var RUSTFLAGS
tc_var CFLAGS
tc_var CXXFLAGS
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang-18 libelf-dev zlib1g-dev libnuma-dev
version: latest
- name: Configure LLVM
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends linux-headers-$(uname -r)
sudo ln -s /usr/include/asm-generic /usr/include/asm
sudo rm -f /bin/clang && sudo ln -s /usr/bin/clang-18 /bin/clang && sudo ln -s /usr/bin/llvm-strip-18 /bin/llvm-strip
git clone --recurse-submodules https://github.com/libbpf/bpftool.git
cd bpftool/src && make && sudo make install
- name: Dump BTF
run: |
mkdir -p include
bpftool btf dump file /sys/kernel/btf/vmlinux format c > include/vmlinux.h
- name: Run tests
run: cargo test --bin nesquic --locked --verbose
- uses: Swatinem/rust-cache@v2
base:
name: Build base images
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build base rust image
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile.rust
tags: nesquic/rust
load: true
cache-from: type=gha,scope=rust
cache-to: type=gha,mode=max,scope=rust
- name: Build mahimahi image
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile.mahimahi
tags: nesquic/mahimahi
load: true
cache-from: type=gha,scope=mahimahi
cache-to: type=gha,mode=max,scope=mahimahi
- name: Export base images
run: docker save nesquic/rust nesquic/mahimahi -o base-images.tar
- uses: actions/upload-artifact@v7
with:
name: base-images
path: base-images.tar
libraries:
name: Test ${{ matrix.library }}
needs: base
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
library: [quinn, quiche, neqo, noq, msquic]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: base-images
- name: Load base images
run: docker load -i base-images.tar
- name: Build library image
run: docker build -f docker/Dockerfile.${{ matrix.library }} -t nesquic/${{ matrix.library }} .
- name: Test
run: script/test.sh ${{ matrix.library }}