Skip to content

Commit

Permalink
Merge pull request merzlab#380 from ohearnk/github-tests-workflow-act…
Browse files Browse the repository at this point in the history
…ion-artifact-updates

Update Github CI workflows for CPU builds and tests
  • Loading branch information
merzlab authored Oct 11, 2024
2 parents 1d6cf2d + a3693b2 commit 47eb00b
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 148 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build_test_mpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: 'Build and Test QUICK MPI Version'

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
build-and-test-mpi-legacy-configure-make:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Install Dependencies for MPI Version'
run: |
sudo apt-get update
sudo apt-get -y install gfortran openmpi-bin openmpi-common libopenmpi-dev
- name: 'Configure MPI Version'
run: ./configure --mpi --enablef --prefix $PWD/install gnu
- name: 'Build and Install MPI Version Using 2 Jobs'
run: make -j2 all install
- name: 'Setup Environment Variables for Running Tests'
run: |
echo "DO_PARALLEL=mpirun -np 2" >> "$GITHUB_ENV"
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
- name: 'Run Tests for MPI Version (Make) Using 2 MPI Processes'
run: make fulltest
- name: 'Archive Test Results for MPI Version'
if: always()
uses: actions/upload-artifact@v4
with:
name: 'mpi-legacy-configure-make-tests'
path: /home/runner/work/QUICK/QUICK/install/test/runs/mpi
retention-days: 3
- uses: actions/download-artifact@v4
with:
name: 'mpi-legacy-configure-make-tests'
- name: 'Display Artifacts'
run: ls -R
build-and-test-mpi-cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Install Dependencies for MPI Version (CMake)'
run: |
sudo apt-get update
sudo apt-get -y install gfortran cmake openmpi-bin openmpi-common libopenmpi-dev
- name: 'Configure MPI Version (CMake)'
run: |
mkdir build
cd build
cmake .. -DCOMPILER=GNU -DMPI=TRUE -DENABLEF=TRUE -DCMAKE_INSTALL_PREFIX=$PWD/../install
- name: 'Build and Install MPI Version (CMake) Using 2 Jobs'
run: |
cd build
cmake --build . --parallel 2
cmake --install .
- name: 'Setup Environment Variables for Running Tests'
run: |
echo "DO_PARALLEL=mpirun -np 2" >> "$GITHUB_ENV"
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
- name: 'Run Tests for MPI Version Using 2 MPI Processes'
run: |
cd install
./runtest --mpi --full
- name: 'Archive Test Results for MPI Version (CMake)'
if: always()
uses: actions/upload-artifact@v4
with:
name: 'mpi-cmake-tests'
path: /home/runner/work/QUICK/QUICK/install/test/runs/mpi
retention-days: 3
72 changes: 72 additions & 0 deletions .github/workflows/build_test_serial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'Build and Test QUICK Serial Version'

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
build-and-test-serial-legacy-configure-make:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Install Dependencies for Serial Version'
run: |
sudo apt-get update
sudo apt-get -y install gfortran
- name: 'Configure Serial Version'
run: ./configure --serial --enablef --prefix $PWD/install gnu
- name: 'Build and Install Serial Version Using 2 Jobs'
run: make -j2 all install
- name: 'Setup Environment Variables for Running Tests'
run: |
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
- name: 'Run Tests for Serial Version (Make)'
run: make fulltest
- name: 'Archive Test Results for Serial Version'
if: always()
uses: actions/upload-artifact@v4
with:
name: 'serial-legacy-configure-make-tests'
path: /home/runner/work/QUICK/QUICK/install/test/runs/serial
retention-days: 3
- uses: actions/download-artifact@v4
with:
name: 'serial-legacy-configure-make-tests'
- name: 'Display Artifacts'
run: ls -R
build-and-test-serial-cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Install Dependencies for Serial Version (CMake)'
run: |
sudo apt-get update
sudo apt-get -y install gfortran cmake
- name: 'Configure Serial Version (CMake)'
run: |
mkdir build
cd build
cmake .. -DCOMPILER=GNU -DENABLEF=TRUE -DCMAKE_INSTALL_PREFIX=$PWD/../install
- name: 'Build and Install Serial Version (CMake) Using 2 Jobs'
run: |
cd build
cmake --build . --parallel 2
cmake --install .
- name: 'Setup Environment Variables for Running Tests'
run: |
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
- name: 'Run Tests for Serial Version'
run: |
cd install
./runtest --serial --full
- name: 'Archive Test Results for Serial Version (CMake)'
if: always()
uses: actions/upload-artifact@v4
with:
name: 'serial-cmake-tests'
path: /home/runner/work/QUICK/QUICK/install/test/runs/serial
retention-days: 3
73 changes: 0 additions & 73 deletions .github/workflows/mpi.yml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/serial.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="right">
<img src="https://github.com/Madu86/QUICK/workflows/Serial%20Build/badge.svg">
<img src="https://github.com/Madu86/QUICK/workflows/MPI%20Build/badge.svg">
<img src='https://readthedocs.org/projects/quick-docs/badge/?version=latest' alt='Documentation Status' />
<img src="https://github.com/merzlab/QUICK/workflows/Build%20and%20Test%20QUICK%20Serial%20Version/badge.svg">
<img src="https://github.com/merzlab/QUICK/workflows/Build%20and%20Test%20QUICK%20MPI%20Version/badge.svg">
<img src='https://readthedocs.org/projects/quick-docs/badge/?version=latest' alt='Documentation Status' />
</p>
<p align="left">
<img width="299" height="169" src="./tools/logo.png">
Expand Down
6 changes: 3 additions & 3 deletions tools/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ run_test(){

# Run the test case
if [ $buildtype = 'mpi' ] || [ $buildtype = 'cudampi' ] || [ $buildtype = 'hipmpi' ] && [ $ismpirun = 'yes' ]; then
$DO_PARALLEL "$qbindir/$qexe" "$t.in" > /dev/null 2>&1
eval "$DO_PARALLEL $qbindir/$qexe $t.in" > /dev/null 2>&1
else
"$qbindir/$qexe" "$t.in" > /dev/null 2>&1
fi
Expand All @@ -495,7 +495,7 @@ run_api_test(){

#Run test
if [ $buildtype = 'mpi' ] || [ $buildtype = 'cudampi' ] || [ $buildtype = 'hipmpi' ] && [ $ismpirun = 'yes' ]; then
$DO_PARALLEL "$apipath/$apiexe" > /dev/null 2>&1
eval "$DO_PARALLEL $apipath/$apiexe" > /dev/null 2>&1
else
"$apipath/$apiexe" > /dev/null 2>&1
fi
Expand Down Expand Up @@ -855,7 +855,7 @@ fi
if [ "$mpi" = 'yes' -o "$cudampi" = 'yes' -o "$hipmpi" = 'yes' ]; then
mpimsg=""
if [ -z "$DO_PARALLEL" ]; then
echo "Error: MPI/CUDAMPI tests are requested but DO_PARALLEL variable is not set."
echo "Error: MPI/MPI+X tests are requested but DO_PARALLEL variable is not set."
exit 1
else
ismpirun='yes'
Expand Down

0 comments on commit 47eb00b

Please sign in to comment.