Skip to content

Commit

Permalink
ajm/GitHub actions icd tests (#1348)
Browse files Browse the repository at this point in the history
* add new icd test workflow and action files

* needs sequential execution

* use checkout action to clone ICD repo

* path field does not accept environment variables

* used underscore instead of dash

* macOS is using a fixed port number now

* macOS-12 needs a seperate runner otherwise it conflicts with the main CI workflow

* only run using schedule on the default branch, should be dev in our case
  • Loading branch information
Anthony Moraghan authored Dec 21, 2023
1 parent ffad503 commit c9a4ab8
Show file tree
Hide file tree
Showing 3 changed files with 1,129 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/actions/run-apptainer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Run ICD tests via Apptainer'
description: 'Start carta_backend and run ICD tests'
inputs:
os_version:
description: 'Platfrom'
required: true
image:
description: 'Apptainer image'
required: true
port:
description: 'Port number for carta_backend'
required: true
test_stage_name:
description: 'ICD test stage'
required: true

runs:
using: 'composite'
steps:
- run: |
SRC_DIR=$GITHUB_WORKSPACE/source
BUILD_DIR=$GITHUB_WORKSPACE/build-${{ inputs.os_version }}
TEST_STAGE="$BUILD_DIR/ICD-RxJS/ICD_test_stages/${{ inputs.test_stage_name }}.tests"
LOG_FILE="/tmp/carta_icd_${{ inputs.os_version }}_${{ inputs.test_stage_name }}.log"
apptainer exec \
--bind $GITHUB_WORKSPACE:$GITHUB_WORKSPACE \
--bind /images:/images \
--pwd $BUILD_DIR \
${{ inputs.image }} /bin/bash -c "\
# Start the 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 ${{ inputs.port }} \
--omp_threads=4 \
--debug_no_auth \
--no_frontend \
--no_database \
--no_log \
--verbosity=5 >> $LOG_FILE 2>&1 & \
CARTA_BACKEND_PID=\$(pgrep -f 'carta_backend.*${{ inputs.port }}' | head -n 1) && \
echo 'carta_backend started with PID' \$CARTA_BACKEND_PID && \
# Run the ICD tests
cd $BUILD_DIR/ICD-RxJS && \
pwd && \
cat $TEST_STAGE && \
while IFS= read -r test_file || [[ -n "\$test_file" ]]; do
CI=true npm test -- "\$test_file"
done < $TEST_STAGE"
shell: bash
36 changes: 36 additions & 0 deletions .github/actions/run-macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Run ICD tests on macOS'
description: 'Start the carta_backend, run the ICD tests, and stop the carta_backend'
inputs:
test_stage_name:
description: 'ICD test stage'
required: true
runs:
using: 'composite'
steps:
- name: Start the carta-backend
run: |
SRC_DIR=$GITHUB_WORKSPACE/source
BUILD_DIR=$GITHUB_WORKSPACE/build
cd $BUILD_DIR
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 5555 \
--omp_threads=4 --debug_no_auth --no_frontend --no_database --verbosity=5 &
echo "CARTA_BACKEND_PID=$!" >> $GITHUB_ENV
shell: bash

- name: ICD tests
run: |
ICD_DIR=$GITHUB_WORKSPACE/ICD-RxJS
cd $ICD_DIR
for test_file in $(cat ICD_test_stages/${{ inputs.test_stage_name }}.tests); do
CI=true npm test $test_file
sleep 3 && pgrep carta_backend
done
shell: bash

- name: Stop carta-backend
run: kill ${{ env.CARTA_BACKEND_PID }}
shell: bash
Loading

0 comments on commit c9a4ab8

Please sign in to comment.