Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0b99994
Add rust based test helpers
LDiazN Jul 15, 2025
b81cca4
Add first iteration of echo test helper
LDiazN Jul 15, 2025
f5b8776
Add logging
LDiazN Jul 16, 2025
b378700
Progress porting json helper
LDiazN Jul 16, 2025
20e7779
Write response back to sender
LDiazN Jul 17, 2025
adc4233
Add ooniprobe-helpers crate to workspace
LDiazN Jul 17, 2025
21fcbe2
Add headers dict to response
LDiazN Jul 17, 2025
dcbeb0f
Check for too many headers or header size
LDiazN Jul 17, 2025
ab82d9a
Cargo fmt
LDiazN Jul 17, 2025
9be64b0
Update documentation
LDiazN Jul 17, 2025
f2b6da6
cargo clippy
LDiazN Jul 17, 2025
ac4a4a3
cargo fmt
LDiazN Jul 17, 2025
c6bfc71
Process requests concurrently with spawn
LDiazN Jul 18, 2025
a110d91
refactor echo test helper to run forever
LDiazN Aug 7, 2025
a8db79d
Fix buffer size
LDiazN Aug 7, 2025
522ca40
Apply clippy recommendations
LDiazN Aug 7, 2025
e1b0797
Parse headers with json test helper
LDiazN Aug 12, 2025
4248656
Add request line header parsing to jsonth
LDiazN Aug 12, 2025
efb230c
Simplify make_response
LDiazN Aug 12, 2025
2c50259
Cargo fmt and cargo clippy
LDiazN Aug 12, 2025
88145d2
remove unused httparse crate
LDiazN Aug 12, 2025
4be7426
Update lockfile
LDiazN Aug 12, 2025
d523f55
reformat
LDiazN Aug 12, 2025
f7b2d54
Add jsonth entry to makefile
LDiazN Aug 12, 2025
35df549
Update outdated comment
LDiazN Aug 13, 2025
9c02db2
Remove duplicated ooniprobe-helpers entry
LDiazN Aug 13, 2025
dda6b6c
Use hyper-util and tokio versions from workspace
LDiazN Aug 13, 2025
39827a4
Rename socket to stream
LDiazN Aug 13, 2025
3cac42f
Change hard failure for error log in tcp and http servers
LDiazN Aug 13, 2025
3dc13bf
Simplify echo test helper
LDiazN Aug 13, 2025
bd8424b
Improve error handling
LDiazN Aug 13, 2025
3108a49
Improve error handling
LDiazN Aug 13, 2025
579e09f
Set code in comment to be json
LDiazN Aug 13, 2025
77c3a6a
Add CI to test test-helpers
LDiazN Aug 19, 2025
14dcb00
Update test_helpers.yml
LDiazN Aug 19, 2025
e60379b
Update test_helpers.yml
LDiazN Aug 19, 2025
f84f03a
Create build_test_helpers.yml
LDiazN Aug 19, 2025
56abe12
Update build_test_helpers.yml
LDiazN Aug 19, 2025
d919bef
Update build_test_helpers.yml
LDiazN Aug 19, 2025
a9fc2a5
Update build_test_helpers.yml
LDiazN Aug 19, 2025
1b55f7c
Update build_test_helpers.yml
LDiazN Aug 19, 2025
730c4e1
Update build_test_helpers.yml
LDiazN Aug 19, 2025
f119628
Update build_test_helpers.yml
LDiazN Aug 19, 2025
7836bff
Update build_test_helpers.yml
LDiazN Aug 19, 2025
3f8a338
Rename build_test_helpers.yml to build_and_release.yml
LDiazN Aug 21, 2025
72c046c
Update build_and_release.yml
LDiazN Aug 21, 2025
cf71cd7
Update build_and_release.yml
LDiazN Aug 21, 2025
6a47460
Update build_and_release.yml
LDiazN Aug 21, 2025
88397fd
Update build_and_release.yml
LDiazN Aug 21, 2025
223c480
Update build_and_release.yml
LDiazN Aug 21, 2025
5fb6e63
Update build_and_release.yml
LDiazN Aug 21, 2025
08bafe1
Update build_and_release.yml
LDiazN Aug 21, 2025
d5d4089
Update build_and_release.yml
LDiazN Aug 21, 2025
07e7523
Update build_and_release.yml
LDiazN Aug 21, 2025
4398c21
Update build_and_release.yml
LDiazN Aug 21, 2025
98cabd1
Update build_and_release.yml
LDiazN Aug 21, 2025
6dbdf15
Update build_and_release.yml
LDiazN Aug 21, 2025
e4582f2
Update build_and_release.yml
LDiazN Aug 21, 2025
aab3e1a
Update build_and_release.yml
LDiazN Aug 21, 2025
8d3bbe5
Update build_and_release.yml
LDiazN Aug 21, 2025
6544b14
Update build_and_release.yml
LDiazN Aug 21, 2025
556eb1a
Update build_and_release.yml
LDiazN Aug 21, 2025
9cab79d
Update build_and_release.yml
LDiazN Aug 21, 2025
8801c46
Update build_and_release.yml
LDiazN Aug 22, 2025
dfe51e9
Update build_and_release.yml
LDiazN Aug 22, 2025
bc11a4d
Update build_and_release.yml
LDiazN Aug 22, 2025
2a96577
Update and rename test_helpers.yml to test.yml
LDiazN Aug 22, 2025
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
92 changes: 92 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build and release test helpers
on:
push:
branches:
- 'main'
env:
GH_TOKEN: ${{ github.token }}
permissions:
contents: write # allows creating releases, uploading assets
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5.0.0

- name: Install rustup toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: "stable-x86_64-unknown-linux-gnu"

- name: Cache Cargo registry + build
uses: Swatinem/rust-cache@v2.8.0

- name: Extract crate version
id: version
run: |
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Get short commit hash
id: commit
run: |
HASH="${GITHUB_SHA::4}"
echo "hash=${HASH}" >> $GITHUB_OUTPUT

- name: Build release binary
run: |
CRATES=("ooniprobe-helpers" "ooniprobe-services" "ooniprobe" "ooniprobe-core" )
for crate in "${CRATES[@]}"; do
cargo build --release -p $crate --target-dir ./build/$crate
done

- name: Prepare artifacts
id: prepare
run: |
mkdir -p dist
VERSION="${{ steps.version.outputs.version }}"
HASH="${{ steps.commit.outputs.hash }}"
# All test helpers binaries
PARENT_DIR='./build'
for dir in "$PARENT_DIR"/*/; do
dir_name=$(basename "$dir")
dist_name="${dir_name}@${VERSION}-${HASH}"
mkdir -p "./dist/$dist_name"

# find exec files
exe_files=()
src_dir="$PARENT_DIR/$dir_name/release"
for f in "$src_dir"/*; do [[ -x $f && -f $f ]] && exe_files+=( "$f" ); done

# Copy exe files
if (( ${#exe_files[@]} > 0 )); then
cp -r "${exe_files[@]}" "./dist/$dist_name/"
fi

# Copy .so files
if find "$src_dir" -maxdepth 1 -type f -name "*.so" | grep -q .; then
cp -r $src_dir/*.so "./dist/$dist_name"
fi

# Generate .tar.gz files
if [ -n "$(ls -A ./dist/$dist_name/ 2>/dev/null)" ]; then
echo "files to tar: "
ls -A ./dist/$dist_name/
tar -czf ./dist/$dist_name.tar.gz -C ./dist/$dist_name/ $(echo ./dist/$dist_name/* | xargs -n1 basename)
fi
done
# Export dist path as step output
echo "dist_dir=$(pwd)/dist" >> $GITHUB_OUTPUT
echo "version_tag=${VERSION}-${HASH}" >> $GITHUB_OUTPUT

- name: Create release
run: |
VERSION_TAG="${{steps.prepare.outputs.version_tag}}"
DIST_DIR="${{steps.prepare.outputs.dist_dir}}"
gh release create $VERSION_TAG $DIST_DIR/*.tar.gz -t "Release $VERSION_TAG" -n "Release binaries for ooniprobe-rs"

- name: Print artifact info
run: |
echo "Artifact successfully built ✅"
echo " Version: ooniprobe-rs@${{ steps.version.outputs.version }}-${{ steps.commit.outputs.hash }}"
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test
on:
pull_request:
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5.0.0

- name: Install rustup toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: "stable-x86_64-unknown-linux-gnu"

- name: Cache Cargo registry + build
uses: Swatinem/rust-cache@v2.8.0

- name: Run tests
run: cargo test --all-features --verbose

Loading