Skip to content

add script to get corpus stats #28

add script to get corpus stats

add script to get corpus stats #28

Workflow file for this run

name: Run Integration Tests
on:
pull_request:
jobs:
get-branch-name:
runs-on: ubuntu-latest
steps:
- name: Get branch name
shell: bash
# The workflow is triggered by pull_request so we use `GITHUB_BASE_REF`
run: echo "branch_name=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT
id: get_branch_name
outputs:
branch_name: ${{ steps.get_branch_name.outputs.branch_name }}
test-cedar-policy:
name: Test Rust implementation
needs: get-branch-name
uses: cedar-policy/cedar/.github/workflows/run_integration_tests_reusable.yml@main
with:
cedar_integration_tests_ref: ${{ github.ref }}
cedar_policy_ref: ${{ needs.get-branch-name.outputs.branch_name }}
test-cedar-spec:
name: Test Lean implementation
needs: get-branch-name
uses: cedar-policy/cedar-spec/.github/workflows/run_integration_tests_reusable.yml@main
with:
cedar_integration_tests_ref: ${{ github.ref }}
cedar_spec_ref: ${{ needs.get-branch-name.outputs.branch_name }}
inspect-corpus:
name: Print corpus statistics
needs: get-branch-name
runs-on: ubuntu-latest
steps:
- name: Download previous corpus
uses: actions/checkout@v4
with:
sparse-checkout: corpus-tests.tar.gz
sparse-checkout-cone-mode: false
ref: ${{ needs.get-branch-name.outputs.branch_name }}
path: old-corpus
- name: Checkout cedar-integration-tests
uses: actions/checkout@v4
- uses: lhotari/action-upterm@v1
- name: Install dependencies
run: pip3 install -r scripts/requirements.txt
- name: Print corpus statistics
run: python3 scripts/get_corpus_stats.py corpus-tests.tar.gz
- name: Compare current corpus against previous corpus
run: python3 scripts/get_corpus_stats.py corpus-tests.tar.gz --original corpus-tests-old.tar.gz