Skip to content

Commit a104441

Browse files
committed
Add missing workflow files which were mistakenly .gitignored
1 parent 146f957 commit a104441

2 files changed

Lines changed: 302 additions & 0 deletions

File tree

.github/workflows/build-ubuntu.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: Ubuntu
2+
on: [push, pull_request]
3+
4+
jobs:
5+
6+
build-and-test-ubuntu:
7+
name: ${{ matrix.row }}
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- row: clang-openssl-baseline
14+
compiler: clang
15+
build_dir: build-ci-quick-clang
16+
sanitizer: none
17+
use_webrtc: false
18+
crypto: default
19+
crypto25519: default
20+
targets: "test_connection test_p2p trivial_signaling_server publish_test_script test_crypto"
21+
- row: gcc-openssl-crypto
22+
compiler: gcc
23+
build_dir: build-ci-quick-gcc
24+
sanitizer: none
25+
use_webrtc: false
26+
crypto: default
27+
crypto25519: default
28+
targets: "test_connection test_p2p trivial_signaling_server publish_test_script test_crypto"
29+
- row: clang-libsodium
30+
compiler: clang
31+
build_dir: build-ci-quick-sodium
32+
sanitizer: none
33+
use_webrtc: false
34+
crypto: libsodium
35+
crypto25519: libsodium
36+
targets: "test_connection test_p2p trivial_signaling_server publish_test_script test_crypto"
37+
- row: clang-reference-25519
38+
compiler: clang
39+
build_dir: build-ci-quick-ref25519
40+
sanitizer: none
41+
use_webrtc: false
42+
crypto: default
43+
crypto25519: Reference
44+
targets: "test_connection test_p2p trivial_signaling_server publish_test_script test_crypto"
45+
- row: clang-openssl-webrtc
46+
compiler: clang
47+
build_dir: build-ci-quick-webrtc
48+
sanitizer: none
49+
use_webrtc: true
50+
crypto: default
51+
crypto25519: default
52+
targets: "test_connection test_p2p trivial_signaling_server publish_test_script test_crypto"
53+
env:
54+
CI_BUILD: 1
55+
IMAGE: ubuntu
56+
IMAGE_TAG: noble
57+
steps:
58+
- uses: actions/checkout@main
59+
# Note only alpine needs "preinstall" step
60+
- name: Update packages
61+
run: sudo -E bash .github/update-packages.sh
62+
- name: Install dependencies
63+
run: |
64+
sudo -E bash .github/install.sh
65+
sudo -E bash .github/install-post.sh
66+
- name: Setup mock IPs
67+
run: sudo python3 tests/test_p2p.py --setup-mock-ips
68+
- name: Build (RelWithDebInfo)
69+
run: |
70+
set -euo pipefail
71+
72+
args=(
73+
--compiler "${{ matrix.compiler }}"
74+
--build-dir "${{ matrix.build_dir }}"
75+
--sanitizer "${{ matrix.sanitizer }}"
76+
)
77+
78+
if [[ "${{ matrix.use_webrtc }}" == "true" ]]; then
79+
args+=(--use-webrtc)
80+
fi
81+
82+
if [[ "${{ matrix.crypto }}" != "default" ]]; then
83+
args+=(--crypto "${{ matrix.crypto }}")
84+
fi
85+
86+
if [[ "${{ matrix.crypto25519 }}" != "default" ]]; then
87+
args+=(--crypto25519 "${{ matrix.crypto25519 }}")
88+
fi
89+
90+
if [[ -n "${{ matrix.targets }}" ]]; then
91+
read -r -a target_args <<< "${{ matrix.targets }}"
92+
args+=(--targets "${target_args[@]}")
93+
fi
94+
95+
python3 .github/run-single-config.py "${args[@]}"
96+
97+
- name: Test crypto (RelWithDebInfo)
98+
run: |
99+
set -euo pipefail
100+
python3 .github/run-single-config.py \
101+
--compiler "${{ matrix.compiler }}" \
102+
--build-dir "${{ matrix.build_dir }}" \
103+
--sanitizer "${{ matrix.sanitizer }}" \
104+
--phase test \
105+
--run-tests \
106+
--tests test_crypto
107+
108+
- name: Test connection (RelWithDebInfo)
109+
run: |
110+
set -euo pipefail
111+
python3 .github/run-single-config.py \
112+
--compiler "${{ matrix.compiler }}" \
113+
--build-dir "${{ matrix.build_dir }}" \
114+
--sanitizer "${{ matrix.sanitizer }}" \
115+
--phase test \
116+
--run-tests \
117+
--tests test_connection:suite-quick
118+
119+
- name: Test p2p (RelWithDebInfo)
120+
run: |
121+
set -euo pipefail
122+
python3 .github/run-single-config.py \
123+
--compiler "${{ matrix.compiler }}" \
124+
--build-dir "${{ matrix.build_dir }}" \
125+
--sanitizer "${{ matrix.sanitizer }}" \
126+
--phase test \
127+
--run-tests \
128+
--tests "test_p2p.py:--spewlevel=debug:--loglevel-p2prendezvous=debug"
129+
130+
- name: Build (Debug)
131+
run: |
132+
set -euo pipefail
133+
134+
args=(
135+
--compiler "${{ matrix.compiler }}"
136+
--build-dir "build-debug"
137+
--build-type Debug
138+
--sanitizer none
139+
)
140+
141+
if [[ "${{ matrix.use_webrtc }}" == "true" ]]; then
142+
args+=(--use-webrtc)
143+
fi
144+
145+
if [[ "${{ matrix.crypto }}" != "default" ]]; then
146+
args+=(--crypto "${{ matrix.crypto }}")
147+
fi
148+
149+
if [[ "${{ matrix.crypto25519 }}" != "default" ]]; then
150+
args+=(--crypto25519 "${{ matrix.crypto25519 }}")
151+
fi
152+
153+
python3 .github/run-single-config.py "${args[@]}"
154+
155+
- name: Build (Release)
156+
run: |
157+
set -euo pipefail
158+
159+
args=(
160+
--compiler "${{ matrix.compiler }}"
161+
--build-dir "build-release"
162+
--build-type Release
163+
--sanitizer none
164+
)
165+
166+
if [[ "${{ matrix.use_webrtc }}" == "true" ]]; then
167+
args+=(--use-webrtc)
168+
fi
169+
170+
if [[ "${{ matrix.crypto }}" != "default" ]]; then
171+
args+=(--crypto "${{ matrix.crypto }}")
172+
fi
173+
174+
if [[ "${{ matrix.crypto25519 }}" != "default" ]]; then
175+
args+=(--crypto25519 "${{ matrix.crypto25519 }}")
176+
fi
177+
178+
python3 .github/run-single-config.py "${args[@]}"
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Windows
2+
on: [push, pull_request]
3+
4+
jobs:
5+
6+
build-and-test-windows:
7+
name: ${{ matrix.os-version }} ${{ matrix.crypto }}
8+
runs-on: windows-${{ matrix.os-version }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
# Windows Server 2019 has been retired. The Windows Server 2019 image has been removed as of 2025-06-30. For more details, see https://github.com/actions/runner-images/issues/12045
13+
os-version: [2022, 2025]
14+
crypto: [OpenSSL, BCrypt]
15+
env:
16+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
17+
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-bincache
18+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg-bincache,readwrite
19+
steps:
20+
- uses: actions/checkout@main
21+
22+
- name: Setup mock IPs
23+
run: py -3 tests/test_p2p.py --setup-mock-ips
24+
shell: cmd
25+
26+
# Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors.
27+
# See https://github.com/actions/checkout/issues/766
28+
- name: Configure Git
29+
run: git config --global --add safe.directory '*'
30+
shell: cmd
31+
32+
- uses: lukka/get-cmake@latest
33+
34+
# Setup MSVC command prompt environment vars.
35+
# We must do this before setting up our local vcpkg,
36+
# Because it will set VCPKG_ROOT to point to some global
37+
# install of vcpkg, and we don't want that
38+
- uses: ilammy/msvc-dev-cmd@v1
39+
40+
- name: set VCPKG_ROOT
41+
run: |
42+
"VCPKG_ROOT=${{ github.workspace }}/vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
43+
shell: pwsh
44+
45+
- name: Setup local vcpkg
46+
run: |
47+
git clone https://github.com/microsoft/vcpkg.git "${{ env.VCPKG_ROOT }}"
48+
cd /d "${{ env.VCPKG_ROOT }}"
49+
git checkout 522253caf47268c1724f486a035e927a42a90092
50+
call bootstrap-vcpkg.bat -disableMetrics
51+
shell: cmd
52+
53+
- name: Ensure vcpkg cache directories exist
54+
run: |
55+
New-Item -ItemType Directory -Path "${{ env.VCPKG_ROOT }}/downloads" -Force | Out-Null
56+
New-Item -ItemType Directory -Path "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" -Force | Out-Null
57+
shell: pwsh
58+
59+
- name: Restore vcpkg caches
60+
uses: actions/cache@v4
61+
with:
62+
path: |
63+
${{ env.VCPKG_ROOT }}/downloads
64+
${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
65+
key: vcpkg-${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.crypto }}-${{ env.VCToolsVersion }}-522253caf47268c1724f486a035e927a42a90092-${{ hashFiles('vcpkg.json') }}
66+
restore-keys: |
67+
vcpkg-${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.crypto }}-${{ env.VCToolsVersion }}-
68+
vcpkg-${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.crypto }}-
69+
70+
- name: vcpkg check / install dependencies
71+
working-directory: '${{ github.workspace }}'
72+
run: '"${{env.VCPKG_ROOT}}\vcpkg" install --vcpkg-root "${{env.VCPKG_ROOT}}" --triplet=x64-windows'
73+
shell: cmd
74+
75+
- name: Configure CMake (RelWithDebInfo)
76+
run: |
77+
mkdir build
78+
cd build
79+
cmake -S .. -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON "-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DUSE_CRYPTO=${{matrix.crypto}}
80+
shell: cmd
81+
82+
- name: Build (RelWithDebInfo)
83+
working-directory: '${{ github.workspace }}/build'
84+
run: ninja
85+
shell: cmd
86+
87+
- name: Test crypto
88+
working-directory: '${{ github.workspace }}/build/bin'
89+
run: test_crypto.exe
90+
shell: cmd
91+
92+
- name: Test connection
93+
working-directory: '${{ github.workspace }}/build/bin'
94+
run: test_connection.exe suite-quick
95+
shell: cmd
96+
97+
- name: Test p2p
98+
working-directory: '${{ github.workspace }}/build/bin'
99+
run: py -3 test_p2p.py --spewlevel=debug --loglevel-p2prendezvous=debug
100+
shell: cmd
101+
102+
- name: Configure CMake (Release)
103+
run: |
104+
mkdir build-release
105+
cd build-release
106+
cmake -S .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON "-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DUSE_CRYPTO=${{matrix.crypto}}
107+
shell: cmd
108+
109+
- name: Build (Release)
110+
working-directory: '${{ github.workspace }}/build-release'
111+
run: ninja
112+
shell: cmd
113+
114+
- name: Configure CMake (Debug)
115+
run: |
116+
mkdir build-debug
117+
cd build-debug
118+
cmake -S .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON "-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DUSE_CRYPTO=${{matrix.crypto}}
119+
shell: cmd
120+
121+
- name: Build (Debug)
122+
working-directory: '${{ github.workspace }}/build-debug'
123+
run: ninja
124+
shell: cmd

0 commit comments

Comments
 (0)