diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..cb415da6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,61 @@ +name: Build and Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + codes: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup MPI + uses: mpi4py/setup-mpi@v1 + - name: Install Prerequisites + run: | + sudo apt-get update -y + sudo apt-get install cmake -y + - name: Cache ROSS + id: cache-ross + uses: actions/cache@v3 + env: + cache-name: cache-ross + with: + path: | + ~/ross + key: v8.0.0 + - if: ${{ steps.cache-ross.outputs.cache-hit != 'true' }} + name: Build ROSS + run: | + cd ~ + git clone http://github.com/ross-org/ROSS.git + cd ROSS + mkdir build + cd build + mkdir -p ~/install/ross + ARCH=x86_64 CC=mpicc CXX=mpicxx cmake -DCMAKE_INSTALL_PREFIX=~/install/ross ../ + make -j8 + make install + - name: Build CODES + run: | + cd ~ + git clone https://github.com/codes-org/codes.git + cd codes + sh prepare.sh + mkdir build + cd build + mkdir -p ~/install/codes + ../configure --prefix=$HOME/install/codes CC=mpicc CXX=mpicxx PKG_CONFIG_PATH=~/install/ross/lib/pkgconfig + make -j8 + - name: Check CODES + run: | + cd ~/codes/build + make tests + make check | tee checklog.txt + test `sed -n '/^# FAIL:/ s/.*[^0-9]\([0-9]\+\)$/\1/p' checklog.txt` == "0"