Skip to content

Fix leading zero handling of CIDs in DAG-CBOR #231

Fix leading zero handling of CIDs in DAG-CBOR

Fix leading zero handling of CIDs in DAG-CBOR #231

Workflow file for this run

name: Unit tests
on: [ pull_request ]
permissions:
contents: read
env:
UV_PYTHON: 3.8 # minimum supported version
DASL_TESTING_REF: "56f7fd74a8eb0955670dab139034e845329dca57"
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository.
uses: actions/checkout@v4
- name: Install UV.
uses: astral-sh/setup-uv@v6
- name: Install dependencies.
run: uv sync --group testing
- name: Compile.
run: uv pip install -v -e .
env:
RUST_BACKTRACE: 1
- name: Run Tests.
run: uv run pytest
- name: Checkout dasl-testing.
uses: actions/checkout@v4
with:
repository: hyphacoop/dasl-testing
path: dasl-testing
ref: ${{ env.DASL_TESTING_REF }}
- name: Run DASL Python harness.
working-directory: dasl-testing/harnesses/python
env:
UV_PYTHON: "3.13" # DASL testing requires Python 3.13+
run: |
RESULT_JSON=$(uv run --with cbor2 python main.py libipld)
{
echo "## DASL Results"
echo
echo "Metadata:"
echo
echo "- Link: $(echo "$RESULT_JSON" | jq -r '.metadata.link')"
echo "- Version: $(echo "$RESULT_JSON" | jq -r '.metadata.version')"
echo
echo "### Per-file summary"
echo
echo "| File | Total | Passed | Failed |"
echo "|------|-------|--------|--------|"
echo "$RESULT_JSON" | jq -r '
.files
| to_entries[]
| .key as $file
| ( [ .value[] | .pass ] ) as $passes
| ($passes | length) as $total
| ($passes | map(select(. == true)) | length) as $passed
| ($total - $passed) as $failed
| "| \($file) | \($total) | \($passed) | \($failed) |"
'
} >> "$GITHUB_STEP_SUMMARY"