55 - master
66 pull_request :
77 types : [opened, synchronize, reopened]
8+
89jobs :
910 build :
1011 name : Verify SIF files and CLASSF.DB consistency
1112 runs-on : ubuntu-latest
13+
1214 steps :
1315 - name : Checkout SIFDecode
1416 uses : actions/checkout@v4
@@ -17,12 +19,12 @@ jobs:
1719 shell : bash
1820 run : |
1921 cd $GITHUB_WORKSPACE/../
20- git clone https://bitbucket.org/optrove/sif
22+ git clone https://github.com/ralna/SIF.git
2123
2224 - name : Check entries in CLASSF.DB and SIF files
2325 shell : bash
2426 run : |
25- cd $GITHUB_WORKSPACE/../sif
27+ cd $GITHUB_WORKSPACE/../SIF
2628
2729 # Read the CLASSF.DB file and store the problem names in an array
2830 mapfile -t db_problems < <(awk '{print $1}' CLASSF.DB)
@@ -31,18 +33,34 @@ jobs:
3133 missing_sif_count=0
3234 missing_db_count=0
3335
34- # Check if each SIF file has an entry in CLASSF.DB
36+ # Collect all available problems from:
37+ # *.SIF
38+ # *.SIF.bz2
39+ declare -A sif_problems
40+
41+ shopt -s nullglob
42+
3543 for file in *.SIF; do
36- problem_name="${file%.SIF}"
44+ sif_problems["${file%.SIF}"]=1
45+ done
46+
47+ for file in *.SIF.bz2; do
48+ sif_problems["${file%.SIF.bz2}"]=1
49+ done
50+
51+ # Check that every SIF/SIF.bz2 file is listed in CLASSF.DB
52+ for problem_name in "${!sif_problems[@]}"; do
3753 if [[ " ${db_problems[*]} " != *" ${problem_name} "* ]]; then
3854 echo "${problem_name} is ABSENT from CLASSF.DB"
3955 missing_db_count=$((missing_db_count + 1))
4056 fi
4157 done
4258
43- # Check if each entry in CLASSF.DB has a corresponding SIF file
59+ # Check that every CLASSF.DB entry has either:
60+ # problem.SIF
61+ # problem.SIF.bz2
4462 for problem in "${db_problems[@]}"; do
45- if [[ ! -f "${problem}.SIF" ]]; then
63+ if [[ ! -f "${problem}.SIF" && ! -f "${problem}.SIF.bz2" ]]; then
4664 echo "SIF file for ${problem} is MISSING"
4765 missing_sif_count=$((missing_sif_count + 1))
4866 fi
5169 echo "Total number of SIF files without DB entries: ${missing_db_count}"
5270 echo "Total number of DB entries without SIF files: ${missing_sif_count}"
5371
54- # Exit with error if any issues were found
5572 if [ "${missing_db_count}" -ne 0 ] || [ "${missing_sif_count}" -ne 0 ]; then
5673 echo "Error: Mismatch between CLASSF.DB entries and SIF files"
5774 exit 1
0 commit comments