Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github action for building and testing codes #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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"