try while IFS loop instead of cat #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux ICD tests | |
on: | |
push: | |
schedule: | |
- cron: '0 0 * * *' # UTC time | |
env: | |
ICD_RXJS_BRANCH_NAME: ajm/icd-test-stages-lists | |
jobs: | |
Build: | |
name: Build ${{ matrix.os_version }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os_version: ubuntu-20.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2004-dec2023.sif | |
- os_version: ubuntu-22.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2204-dec2023.sif | |
- os_version: rhel-7 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/centos7-dec3023.sif | |
- os_version: rhel-8 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/almalinux8-dec3023.sif | |
- os_version: rhel-9 | |
runner: [self-hosted, linux, Apptainer, ICD3] | |
image: /opt/apptainer/almalinux9-dec3023.sif | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: source | |
- name: Build backend | |
shell: bash | |
run: | | |
SRC_DIR=$GITHUB_WORKSPACE/source | |
BUILD_DIR=$GITHUB_WORKSPACE/build-${{ matrix.os_version }} | |
rm -rf $BUILD_DIR | |
mkdir -p $BUILD_DIR | |
apptainer exec --bind $GITHUB_WORKSPACE:$GITHUB_WORKSPACE --pwd $SRC_DIR ${{ matrix.image }} /bin/bash -c "\ | |
git submodule update --init --recursive && \ | |
cd $BUILD_DIR && \ | |
cmake $SRC_DIR \ | |
-Dtest=on \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DDevSuppressExternalWarnings=ON \ | |
-DCMAKE_CXX_FLAGS='-O0 -g -fsanitize=address -fno-omit-frame-pointer' \ | |
-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=address' && \ | |
make -j 16" | |
- name: Check backend runs | |
shell: bash | |
run: | | |
BUILD_DIR=$GITHUB_WORKSPACE/build-${{ matrix.os_version }} | |
apptainer exec --bind $GITHUB_WORKSPACE:$GITHUB_WORKSPACE --pwd $BUILD_DIR ${{ matrix.image }} /bin/bash -c "./carta_backend --version" | |
Prepare-ICD-RxJS: | |
name: Prepare-ICD-RxJS ${{ matrix.os_version }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os_version: ubuntu-20.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2004-dec2023.sif | |
port: 9001 | |
- os_version: ubuntu-22.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2204-dec2023.sif | |
port: 9002 | |
- os_version: rhel-7 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/centos7-dec3023.sif | |
port: 9003 | |
- os_version: rhel-8 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/almalinux8-dec3023.sif | |
port: 9004 | |
- os_version: rhel-9 | |
runner: [self-hosted, linux, Apptainer, ICD3] | |
image: /opt/apptainer/almalinux9-dec3023.sif | |
port: 9005 | |
needs: Build | |
steps: | |
- name: Prepare ICD-RxJS | |
shell: bash | |
run: | | |
BUILD_DIR=$GITHUB_WORKSPACE/build-${{ matrix.os_version }} | |
ICD_RXJS_DIR=$BUILD_DIR/ICD-RxJS | |
apptainer exec --bind $GITHUB_WORKSPACE:$GITHUB_WORKSPACE --pwd $BUILD_DIR ${{ matrix.image }} /bin/bash -c "\ | |
if [ -d '$ICD_RXJS_DIR' ]; then | |
cd $ICD_RXJS_DIR && git pull | |
else | |
echo 'Cloning ICD-RxJS repository...' | |
git clone https://github.com/CARTAvis/ICD-RxJS.git | |
cd ICD-RxJS | |
fi && \ | |
git checkout ${{ env.ICD_RXJS_BRANCH_NAME }} && \ | |
git submodule init && git submodule update && npm install && \ | |
cd protobuf && \ | |
./build_proto.sh && \ | |
cd ../src/test && \ | |
perl -p -i -e 's/3002/${{ matrix.port }}/' config.json" | |
File-Browser-ICD-Tests: | |
name: File-Browser ${{ matrix.os_version }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os_version: ubuntu-20.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2004-dec2023.sif | |
port: 9001 | |
- os_version: ubuntu-22.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2204-dec2023.sif | |
port: 9002 | |
- os_version: rhel-7 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/centos7-dec3023.sif | |
port: 9003 | |
- os_version: rhel-8 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/almalinux8-dec3023.sif | |
port: 9004 | |
- os_version: rhel-9 | |
runner: [self-hosted, linux, Apptainer, ICD3] | |
image: /opt/apptainer/almalinux9-dec3023.sif | |
port: 9005 | |
needs: [Build, Prepare-ICD-RxJS] | |
steps: | |
- name: File Browser ICD tests | |
shell: bash | |
run: | | |
SRC_DIR=$GITHUB_WORKSPACE/source | |
BUILD_DIR=$GITHUB_WORKSPACE/build-${{ matrix.os_version }} | |
LOG_FILE="/tmp/carta_icd_${{ matrix.os_version }}_${TEST_STAGE}.log" | |
TEST_FILES="$BUILD_DIR/ICD-RxJS/ICD_test_stages/file_browser.tests" | |
apptainer exec \ | |
--bind $GITHUB_WORKSPACE:$GITHUB_WORKSPACE \ | |
--bind /images:/images \ | |
--pwd $BUILD_DIR \ | |
${{ matrix.image }} /bin/bash -c "\ | |
# Start carta_backend | |
ASAN_OPTIONS=suppressions=$SRC_DIR/debug/asan/myasan.supp \ | |
LSAN_OPTIONS=suppressions=$SRC_DIR/debug/asan/myasan-leaks.supp \ | |
ASAN_SYMBOLIZER_PATH=llvm-symbolizer \ | |
./carta_backend /images \ | |
--top_level_folder /images \ | |
--port ${{ matrix.port }} \ | |
--omp_threads=4 \ | |
--debug_no_auth \ | |
--no_frontend \ | |
--no_database \ | |
--verbosity=5 >> $LOG_FILE 2>&1 & \ | |
sleep 5 && \ | |
CARTA_BACKEND_PID=$(pgrep -f carta_backend) && \ | |
echo 'carta_backend started with PID: $CARTA_BACKEND_PID' && \ | |
cat $TEST_FILES && \ | |
while IFS= read -r test_file || [ -n "$test_file" ]; do | |
CI=true npm test "$test_file" | |
sleep 3 && pgrep carta_backend | |
done < "$TEST_FILES" && \ | |
kill $CARTA_BACKEND_PID" | |
Animator-ICD-Tests: | |
name: Animator ${{ matrix.os_version }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os_version: ubuntu-20.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2004-dec2023.sif | |
port: 9001 | |
- os_version: ubuntu-22.04 | |
runner: [self-hosted, Linux, Apptainer, ICD1] | |
image: /opt/apptainer/ubuntu-2204-dec2023.sif | |
port: 9002 | |
- os_version: rhel-7 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/centos7-dec3023.sif | |
port: 9003 | |
- os_version: rhel-8 | |
runner: [self-hosted, linux, Apptainer, ICD2] | |
image: /opt/apptainer/almalinux8-dec3023.sif | |
port: 9004 | |
- os_version: rhel-9 | |
runner: [self-hosted, linux, Apptainer, ICD3] | |
image: /opt/apptainer/almalinux9-dec3023.sif | |
port: 9005 | |
needs: [File-Browser-ICD-Tests, Prepare-ICD-RxJS] | |
steps: | |
- name: Animator ICD tests | |
shell: bash | |
run: | | |
SRC_DIR=$GITHUB_WORKSPACE/source | |
BUILD_DIR=$GITHUB_WORKSPACE/build-${{ matrix.os_version }} | |
LOG_FILE="/tmp/carta_icd_${{ matrix.os_version }}_${TEST_STAGE}.log" | |
TEST_FILES="$BUILD_DIR/ICD-RxJS/ICD_test_stages/animator.tests" | |
apptainer exec \ | |
--bind $GITHUB_WORKSPACE:$GITHUB_WORKSPACE \ | |
--bind /images:/images \ | |
--pwd $BUILD_DIR \ | |
${{ matrix.image }} /bin/bash -c "\ | |
# Start carta_backend | |
ASAN_OPTIONS=suppressions=$SRC_DIR/debug/asan/myasan.supp \ | |
LSAN_OPTIONS=suppressions=$SRC_DIR/debug/asan/myasan-leaks.supp \ | |
ASAN_SYMBOLIZER_PATH=llvm-symbolizer \ | |
./carta_backend /images \ | |
--top_level_folder /images \ | |
--port ${{ matrix.port }} \ | |
--omp_threads=4 \ | |
--debug_no_auth \ | |
--no_frontend \ | |
--no_database \ | |
--verbosity=5 >> $LOG_FILE 2>&1 & \ | |
sleep 5 && \ | |
CARTA_BACKEND_PID=$(pgrep -f carta_backend) && \ | |
echo 'carta_backend started with PID: $CARTA_BACKEND_PID' && \ | |
cat $TEST_FILES && \ | |
while IFS= read -r test_file || [ -n "$test_file" ]; do | |
CI=true npm test "$test_file" | |
sleep 3 && pgrep carta_backend | |
done < "$TEST_FILES" && \ | |
kill $CARTA_BACKEND_PID" |