Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/update-ada.sh

This file was deleted.

78 changes: 32 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
paths-ignore:
- '**/*.md'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
Expand Down Expand Up @@ -42,7 +45,7 @@ jobs:
sudo dpkg --install wasi-sdk-33.0-x86_64-linux.deb
curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v46.0.1/wasmtime-v46.0.1-x86_64-linux.tar.xz
tar xvf wasmtime-v46.0.1-x86_64-linux.tar.xz
echo `pwd`/wasmtime-v46.0.1-x86_64-linux >> $GITHUB_PATH
echo "$PWD/wasmtime-v46.0.1-x86_64-linux" >> "$GITHUB_PATH"

- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -55,68 +58,40 @@ jobs:
uses: taiki-e/install-action@cargo-hack

- name: Clippy
run: cargo hack clippy --feature-powerset -- -D warnings
run: cargo hack clippy --feature-powerset --locked -- -D warnings

- name: Test
# `bundled` must stay enabled for every combination: it is what compiles
# and statically links the C++ ada sources. Without it (and with no
# external ada provided via ADA_LIB_DIR/ADA_LIB_NAME) the test binaries
# fail to link with `undefined symbol: ada_*`. `--features bundled` forces
# it into each powerset entry while still exercising the other features.
run: cargo hack test --feature-powerset --features bundled
run: cargo hack test --feature-powerset --locked

- name: Check Documentation
env:
RUSTDOCFLAGS: '-D warnings'
run: cargo hack doc --feature-powerset
run: cargo hack doc --feature-powerset --locked

external-ada:
name: External ada (non-bundled)
feature-modes:
name: no_std and optional features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: Swatinem/rust-cache@v2
with:
shared-key: external-ada
shared-key: feature-modes
save-if: ${{ github.ref_name == 'main' }}

- run: rustup show

# Exercise the non-bundled linking path: instead of compiling the bundled
# C++ sources, build ada once as a standalone shared library and link the
# crate against it via ADA_LIB_DIR / ADA_LIB_NAME. This mirrors how a host
# build system (Bazel, CMake, a distro package) would provide ada. The
# shared library records its own libstdc++ dependency (DT_NEEDED), so the
# final Rust binary needs no extra C++ runtime link flags.
- name: Build standalone libada.so
run: |
c++ -std=c++20 -O2 -DADA_INCLUDE_URL_PATTERN=0 -Ideps -fPIC -shared \
deps/ada.cpp -o "$RUNNER_TEMP/libada.so"

# `bundled` is intentionally disabled (default-features off). `std` is
# re-enabled because dropping default features also drops it. The serde
# combination is run separately to cover the extra feature on this path.
- name: Test against external ada
env:
ADA_LIB_DIR: ${{ runner.temp }}
ADA_LIB_NAME: ada
LD_LIBRARY_PATH: ${{ runner.temp }}
- name: Test dependency-free core and Serde integration
run: |
cargo test --no-default-features --features std
cargo test --no-default-features --features serde
cargo test --no-default-features --locked
cargo test --no-default-features --features serde --locked

sanitizers:
name: AddressSanitizer + LeakSanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

# AddressSanitizer (which bundles LeakSanitizer) requires nightly. We use
# clang for the bundled C++ so it shares the LLVM sanitizer runtime that
# rustc links into the test binaries. Note: `cargo +nightly` is used
# explicitly because rust-toolchain.toml pins a stable channel that would
# otherwise override the default toolchain in this directory.
- name: Install nightly toolchain
run: rustup toolchain install nightly --profile minimal

Expand All @@ -127,15 +102,8 @@ jobs:

- run: rustup +nightly show

# `--target` is required so build scripts / proc-macros (host) are not
# instrumented. LeakSanitizer is enabled by default under ASan on Linux;
# this catches regressions like https://github.com/ada-url/rust/issues/101
# where the failed-parse path leaked the allocation from `ada_parse`.
- name: Test under AddressSanitizer + LeakSanitizer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the workflows?

env:
CC: clang
CXX: clang++
ADA_SANITIZE: address
RUSTFLAGS: '-Zsanitizer=address'
ASAN_OPTIONS: 'detect_leaks=1'
run: cargo +nightly test --tests --target x86_64-unknown-linux-gnu
Expand Down Expand Up @@ -163,4 +131,22 @@ jobs:

- run: rustup show

- run: cargo clippy -- -D warnings
- run: cargo clippy --all-targets --all-features --locked -- -D warnings

miri:
name: Miri

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is Miri?

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: dtolnay/rust-toolchain@nightly
with:
components: miri

- uses: Swatinem/rust-cache@v2

# Miri interprets Rust MIR to catch undefined behavior that normal tests
# cannot reliably observe. rust-toolchain.toml pins stable, so select
# nightly explicitly.
- run: cargo +nightly miri setup
- run: cargo +nightly miri test --lib --no-default-features
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
sudo dpkg --install wasi-sdk-33.0-x86_64-linux.deb
curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v46.0.1/wasmtime-v46.0.1-x86_64-linux.tar.xz
tar xvf wasmtime-v46.0.1-x86_64-linux.tar.xz
echo `pwd`/wasmtime-v46.0.1-x86_64-linux >> $GITHUB_PATH
echo "$PWD/wasmtime-v46.0.1-x86_64-linux" >> "$GITHUB_PATH"

- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -57,15 +57,15 @@ jobs:
uses: taiki-e/install-action@cargo-hack

- name: Clippy
run: cargo hack clippy --feature-powerset -- -D warnings
run: cargo hack clippy --feature-powerset --locked -- -D warnings

- name: Test
run: cargo hack test --feature-powerset
run: cargo hack test --feature-powerset --locked

- name: Check Documentation
env:
RUSTDOCFLAGS: '-D warnings'
run: cargo hack doc --feature-powerset
run: cargo hack doc --feature-powerset --locked

- name: Check semver
if: matrix.os == 'ubuntu-latest'
Expand Down
91 changes: 0 additions & 91 deletions .github/workflows/update-ada.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/target
/target/
/fuzz/target/
/fuzz/corpus/
/fuzz/artifacts/
/.idea/
/.vscode/
*.profraw
*.profdata
perf.data*
Loading
Loading