Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/workflows/sif_database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/sifdecoder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -43,29 +43,34 @@ 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
shell: bash
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"
Expand Down
Loading