diff --git a/.github/workflows/sif_database.yml b/.github/workflows/sif_database.yml index 2879b61..c74bbcb 100644 --- a/.github/workflows/sif_database.yml +++ b/.github/workflows/sif_database.yml @@ -5,10 +5,12 @@ on: - master pull_request: types: [opened, synchronize, reopened] + jobs: build: name: Verify SIF files and CLASSF.DB consistency runs-on: ubuntu-latest + steps: - name: Checkout SIFDecode uses: actions/checkout@v4 @@ -17,12 +19,12 @@ jobs: shell: bash run: | cd $GITHUB_WORKSPACE/../ - git clone https://bitbucket.org/optrove/sif + git clone https://github.com/ralna/SIF.git - name: Check entries in CLASSF.DB and SIF files shell: bash run: | - cd $GITHUB_WORKSPACE/../sif + cd $GITHUB_WORKSPACE/../SIF # Read the CLASSF.DB file and store the problem names in an array mapfile -t db_problems < <(awk '{print $1}' CLASSF.DB) @@ -31,18 +33,34 @@ jobs: missing_sif_count=0 missing_db_count=0 - # Check if each SIF file has an entry in CLASSF.DB + # Collect all available problems from: + # *.SIF + # *.SIF.bz2 + declare -A sif_problems + + shopt -s nullglob + for file in *.SIF; do - problem_name="${file%.SIF}" + sif_problems["${file%.SIF}"]=1 + done + + for file in *.SIF.bz2; do + sif_problems["${file%.SIF.bz2}"]=1 + done + + # Check that every SIF/SIF.bz2 file is listed in CLASSF.DB + for problem_name in "${!sif_problems[@]}"; do if [[ " ${db_problems[*]} " != *" ${problem_name} "* ]]; then echo "${problem_name} is ABSENT from CLASSF.DB" missing_db_count=$((missing_db_count + 1)) fi done - # Check if each entry in CLASSF.DB has a corresponding SIF file + # Check that every CLASSF.DB entry has either: + # problem.SIF + # problem.SIF.bz2 for problem in "${db_problems[@]}"; do - if [[ ! -f "${problem}.SIF" ]]; then + if [[ ! -f "${problem}.SIF" && ! -f "${problem}.SIF.bz2" ]]; then echo "SIF file for ${problem} is MISSING" missing_sif_count=$((missing_sif_count + 1)) fi @@ -51,7 +69,6 @@ jobs: echo "Total number of SIF files without DB entries: ${missing_db_count}" echo "Total number of DB entries without SIF files: ${missing_sif_count}" - # Exit with error if any issues were found if [ "${missing_db_count}" -ne 0 ] || [ "${missing_sif_count}" -ne 0 ]; then echo "Error: Mismatch between CLASSF.DB entries and SIF files" exit 1 diff --git a/.github/workflows/sifdecoder.yml b/.github/workflows/sifdecoder.yml index 93532b7..64249a4 100644 --- a/.github/workflows/sifdecoder.yml +++ b/.github/workflows/sifdecoder.yml @@ -13,7 +13,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] version: ['12'] - problems: ['sifcollection', 'maros-meszaros', 'netlib-lp'] + problems: ['sif', 'maros-meszaros', 'netlib-lp'] precision: ['single', 'double', 'quadruple'] runs-on: ${{ matrix.os }} steps: @@ -43,16 +43,16 @@ jobs: shell: bash run: | cd $GITHUB_WORKSPACE/../ - if [[ "${{ matrix.problems }}" == "sifcollection" ]]; then - git clone https://bitbucket.org/optrove/sif + if [[ "${{ matrix.problems }}" == "sif" ]]; then + git clone https://github.com/ralna/SIF.git fi if [[ "${{ matrix.problems }}" == "maros-meszaros" ]]; then - git clone https://bitbucket.org/optrove/maros-meszaros - mv maros-meszaros sif + git clone https://github.com/ralna/maros-meszaros + mv maros-meszaros SIF fi if [[ "${{ matrix.problems }}" == "netlib-lp" ]]; then - git clone https://bitbucket.org/optrove/netlib-lp - mv netlib-lp sif + git clone https://github.com/ralna/netlib-lp + mv netlib-lp SIF fi - name: SIFDecode @@ -60,12 +60,17 @@ jobs: run: | meson setup builddir --buildtype=debug -Ddefault_library=static meson compile -C builddir - cp builddir/sifdecoder $GITHUB_WORKSPACE/../sif + cp builddir/sifdecoder $GITHUB_WORKSPACE/../SIF - name: Decode the SIF files shell: bash run: | - cd $GITHUB_WORKSPACE/../sif + cd $GITHUB_WORKSPACE/../SIF + for file in *.SIF.bz2; do + if [ -f "$file" ]; then + bunzip2 -k "$file" + fi + done for file in *.SIF; do if [ -f "$file" ]; then echo "Processing $file"