Skip to content

feat: script qadb-info to dump some info about the QADB #286

feat: script qadb-info to dump some info about the QADB

feat: script qadb-info to dump some info about the QADB #286

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- main
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# get list of datasets to check
info:
runs-on: ubuntu-latest
outputs:
datasets: ${{ steps.datasets.outputs.datasets }}
steps:
- name: checkout
uses: actions/checkout@v4
with: # settings needed for version number detection in qadb-info
clean: false
fetch-tags: true
fetch-depth: 0
- name: add bin to PATH
run: |
source environ.sh
echo "PATH=$PATH" | tee -a $GITHUB_ENV
- name: get data sets
id: datasets
run: |
qadb-info print --list --no-latest --simple | jq -Rs '{"dataset": split("\n")[:-1]}' | tee datasets.json
echo datasets=$(jq -c . datasets.json) >> $GITHUB_OUTPUT
- run: qadb-info --version
- name: qadb-info summary
run: |
echo '```' >> $GITHUB_STEP_SUMMARY
qadb-info print --more | xargs -0 -I{} echo {} >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: test qadb-info example commands
run: |
qadb-info --examples | grep -E '^\$' | sed 's;^\$ ;;' | while read cmd; do
echo "+ $cmd"
$cmd
done
# check consistency between Groovy and C++ APIs
test_dataset:
name: test
needs:
- info
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.info.outputs.datasets) }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: setup_groovy
uses: wtfjoke/setup-groovy@v2
with:
groovy-version: 4.x
- name: env
run: |
source environ.sh
echo "QADB=${QADB}" >> $GITHUB_ENV
echo "JYPATH=${JYPATH}" >> $GITHUB_ENV
- name: make sure all necessary files exist # since pre-commit.ci auto-fix bot will not `git add` *new* files, we fallback to checking their existence here
working-directory: qadb/${{ matrix.dataset }}
run: |
for f in qaTree.json.table miscTable.md; do
if [ ! -f $f ]; then
echo "missing table file '$f'; run pre-commit hook manually and commit new file(s)"
exit 1
fi
done
for f in qaTree.json chargeTree.json; do
if [ ! -f $f ]; then
echo "missing file '$f'"
exit 1
fi
done
- name: sync check
run: stdbuf -i0 -e0 -o0 util/syncCheck.rb ${{ matrix.dataset }}
- name: diff the Groovy and C++ QADB dumps
run: |
make -C srcC/tests
tests/test_diffGroovyCpp.loop.sh ${{ matrix.dataset }}
- name: concatenate artifacts
id: artifacts
run: |
mkdir -p artifacts/${{ matrix.dataset }}
for lang in cpp groovy ; do
cat tmp/${lang}*.out > artifacts/${{ matrix.dataset }}/${lang}.txt ;
done
echo "artifact_name=groovy_vs_cpp__$(echo ${{ matrix.dataset }} | sed 's;/;_;g')" | tee -a $GITHUB_OUTPUT
- name: upload_artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifacts.outputs.artifact_name }}
retention-days: 3
path: artifacts/*
# report status for github status check (successful only if all `test_dataset` jobs pass)
report:
runs-on: ubuntu-latest
needs:
- test_dataset
steps:
- run: echo success