Skip to content

Commit

Permalink
add CI driver script for build process
Browse files Browse the repository at this point in the history
  • Loading branch information
yichengt900 committed Apr 17, 2024
1 parent bd60296 commit 922453f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/NWA12-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@ jobs:
- name: Build MOM6SIS2
run: |
cd ${{ env.TEST_DIR }}/NWA12_CHECK/builds
./linux-build.bash -m gaea -p ncrc5.intel23 -t repro -f mom6sis2
jobid=$(sbatch --parsable ci_build_driver.sh | awk -F';' '{print $1}' | cut -f1)
#
sleep 1
while :; do
job_status=$(squeue -h -j "$jobid" -o "%T" 2>/dev/null)
if [ -z "$job_status" ]; then
echo "Job with ID $jobid is not found or completed."
break
else
echo "Job with ID $jobid is still running."
echo "Job Status: $job_status"
fi
sleep 60 # Adjust the sleep duration as needed
done
#
check_file="${{ env.TEST_DIR }}/NWA12_CHECK/builds/build/gaea-ncrc5.intel23/ocean_ice/repro/MOM6SIS2"
if [ -f "$check_file" ]; then
Expand Down Expand Up @@ -63,7 +76,7 @@ jobs:
echo "Job with ID $jobid is still running."
echo "Job Status: $job_status"
fi
sleep 30 # Adjust the sleep duration as needed
sleep 60 # Adjust the sleep duration as needed
done
#
expected_string="All restart files are identical, PASS"
Expand Down
24 changes: 24 additions & 0 deletions builds/ci_build_driver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --time=60
#SBATCH --job-name="MOM6SIS2_build"
#SBATCH --output=MOM6SIS2_build_o.%j
#SBATCH --error=MOM6SIS2_build_e.%j
#SBATCH --qos=debug
#SBATCH --partition=batch
#SBATCH --clusters=c5
#SBATCH --account=cefi

#

#
[ -d "build" ] && rm -rf build

#
echo "Build started: " `date`

#
./linux-build.bash -m gaea -p ncrc5.intel23 -t repro -f mom6sis2

#
echo "Build ended: " `date`

0 comments on commit 922453f

Please sign in to comment.