add script to get corpus stats #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: pip3 install -r scripts/requirements.txt | |
- name: Print statistics for `corpus-tests.tar.gz` | |
run: python3 scripts/get_corpus_stats.py corpus-tests.tar.gz | |
- name: Get previous corpus | |
run: | | |
cp corpus-tests.tar.gz corpus-tests-new.tar.gz | |
git checkout ${{ needs.get-branch-name.outputs.branch_name }} -- corpus-tests.tar.gz | |
- name: Compare `corpus-tests.tar.gz` against previous corpus | |
run: python3 scripts/get_corpus_stats.py corpus-tests-new.tar.gz --original corpus-tests.tar.gz |