Repository navigation
60 lines (56 loc) · 1.91 KB
/
Copy pathhost-tests.yml
File metadata and controls
60 lines (56 loc) · 1.91 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
name: Host tests
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
name: clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install clang-format==22.1.8
- name: Check
run: git ls-files -z '*.h' '*.cpp' | xargs -0 clang-format --dry-run --Werror
host-tests:
name: ${{ matrix.os }}, ${{ matrix.url }} URL parser
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
# fake: tests/FakeUrl.cpp. ada: the release both runtimes vendor,
# which the identity and resolver tests need to see what a runtime
# parses.
url: [fake, ada]
env:
ADA_VERSION: 4.1.1
ADA_H_SHA256: 99fa32a2e31a61e17598775d9166d7e5b7e648b31e5f4b3b27de59dfb2951bf3
ADA_CPP_SHA256: e693ea65504493eda3a8bbdd0453819256dcace6a50a0f46a8ab1db330f2e98a
steps:
- uses: actions/checkout@v4
- name: Fetch ada
if: matrix.url == 'ada'
run: |
mkdir -p "$RUNNER_TEMP/ada"
cd "$RUNNER_TEMP/ada"
base="https://github.com/ada-url/ada/releases/download/v$ADA_VERSION"
curl -fsSLO "$base/ada.h"
curl -fsSLO "$base/ada.cpp"
printf '%s ada.h\n%s ada.cpp\n' "$ADA_H_SHA256" "$ADA_CPP_SHA256" | shasum -a 256 -c -
echo "NS_ADA_FLAG=-DNS_ADA_DIR=$RUNNER_TEMP/ada" >> "$GITHUB_ENV"
- name: Configure
run: >
cmake -S . -B build
-DNS_RUNTIME_COMMON_HOST_TESTS=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all"
$NS_ADA_FLAG
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure