Skip to content

Commit

Permalink
Add a CI script to test the decoder on three different sets of SIF pr…
Browse files Browse the repository at this point in the history
…oblems
  • Loading branch information
amontoison committed Aug 17, 2024
1 parent c3d5821 commit c1064fc
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_Int${{ matrix.int }}_meson-log.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_meson-log.txt
path: builddir/meson-logs/meson-log.txt

- name: Install SIFDecode
Expand All @@ -71,5 +71,5 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_Int${{ matrix.int }}_install-log.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_install-log.txt
path: builddir/meson-logs/install-log.txt
115 changes: 115 additions & 0 deletions .github/workflows/sifdecoder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: sifdecoder
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: ${{ matrix.problems }} -- ${{ matrix.precision }} precision
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: ['12']
problems: ['sifcollection', 'maros-meszaros', 'netlib-lp']
precision: ['single', 'double', 'quadruple']
runs-on: ${{ matrix.os }}
steps:
- name: Check out SIFDecode
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Meson and Ninja
run: pip install meson ninja

- name: Install compilers
uses: fortran-lang/setup-fortran@main
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# if: matrix.os == 'windows-latest'
# uses: mxschmitt/action-tmate@v3

- name: Download ${{ matrix.problems }}
shell: bash
run: |
cd $GITHUB_WORKSPACE/../
if [[ "${{ matrix.problems }}" == "sifcollection" ]]; then
# https://bitbucket.org/optrove/sif/downloads/?tab=branches
wget https://bitbucket.org/optrove/sif/get/9ee214cf948816fdfbc0e58f844e47172a8784f0.tar.gz
tar -xvzf 9ee214cf948816fdfbc0e58f844e47172a8784f0.tar.gz
mv optrove-sif-9ee214cf9488 sif
fi
if [[ "${{ matrix.problems }}" == "maros-meszaros" ]]; then
# https://bitbucket.org/optrove/maros-meszaros/downloads/?tab=branches
wget https://bitbucket.org/optrove/maros-meszaros/get/9adfb5707b1e0b83a2e0a26cc8310704ff01b7c1.tar.gz
tar -xvzf 9adfb5707b1e0b83a2e0a26cc8310704ff01b7c1.tar.gz
mv optrove-maros-meszaros-9adfb5707b1e sif
fi
if [[ "${{ matrix.problems }}" == "netlib-lp" ]]; then
# https://bitbucket.org/optrove/netlib-lp/downloads/?tab=branches
wget https://bitbucket.org/optrove/netlib-lp/get/f83996fca9370b23d8896f134c4dfe7adbaca0ec.tar.gz
tar -xvzf f83996fca9370b23d8896f134c4dfe7adbaca0ec.tar.gz
mv optrove-netlib-lp-f83996fca937 sif
fi
- name: SIFDecode
shell: bash
run: |
meson setup builddir -Ddefault_library=static
meson compile -C builddir
cp builddir/sifdecoder_standalone $GITHUB_WORKSPACE/../sif
- name: Decode the SIF files
shell: bash
run: |
cd $GITHUB_WORKSPACE/../sif
for file in *.SIF; do
if [ -f "$file" ]; then
echo "Processing $file"
rm -f *.f *.o *.d
if [[ "${{ matrix.precision }}" == "single" ]]; then
if [[ "$file" != "HIELOW.SIF" && \
"$file" != "HS68.SIF" && \
"$file" != "HS69.SIF" && \
"$file" != "PARKCH.SIF" && \
"$file" != "STRATEC.SIF" ]]; then
./sifdecoder_standalone -sp "$file"
gfortran -shared -fPIC *.f
fi
fi
if [[ "${{ matrix.precision }}" == "double" ]]; then
./sifdecoder_standalone -dp "$file"
gfortran -shared -fPIC *.f
fi
if [[ "${{ matrix.precision }}" == "quadruple" ]]; then
if [[ "$file" != "BLEACHNG.SIF" && \
"$file" != "CAR2.SIF" && \
"$file" != "HIELOW.SIF" && \
"$file" != "HS88.SIF" && \
"$file" != "HS89.SIF" && \
"$file" != "HS90.SIF" && \
"$file" != "HS91.SIF" && \
"$file" != "HS92.SIF" && \
"$file" != "JIMACK.SIF" && \
"$file" != "ORBIT2.SIF" && \
"$file" != "PARKCH.SIF" && \
"$file" != "RAYBENDS.SIF" && \
"$file" != "SARO.SIF" && \
"$file" != "SAROMM.SIF" && \
"$file" != "STRATEC.SIF" ]]; then
./sifdecoder_standalone -qp "$file"
gfortran -shared -fPIC *.f
fi
fi
fi
done

0 comments on commit c1064fc

Please sign in to comment.