Skip to content

Merge pull request #804 from CamStan/update_ci_envs #325

Merge pull request #804 from CamStan/update_ci_envs

Merge pull request #804 from CamStan/update_ci_envs #325

name: UnifyFS Build and Test
on:
pull_request:
branches: [ main, dev ]
push:
jobs:
checkpatch:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Checkpatch
run: |
eval $(git log HEAD^..HEAD | sed "s/^ *//g" | grep '^TEST_.*=')
export TEST_CHECKPATCH_SKIP_FILES
(git diff HEAD^..HEAD | ./scripts/checkpatch.sh origin/dev..HEAD) || test "$TEST_CHECKPATCH_ALLOW_FAILURE" = yes
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
compiler: [ gcc ]
gcc: [ 7, 8, 9, 10, 11 ]
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.gcc }}
runs-on: ${{ matrix.os }}
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
steps:
- name: Push checkout
if: github.event_name == 'push'
uses: actions/checkout@v3
- name: PR checkout
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.gcc }}
- name: Install additional packages
run: |
sudo apt-get update
sudo apt-get install libtool-bin
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
- name: Install Spack
uses: kzscisoft/install-spack@v1
with:
version: develop
- name: Set up packages.yaml
run: |
test -f $GITHUB_WORKSPACE/.spack/etc/spack/packages.yaml || cat > $GITHUB_WORKSPACE/.spack/etc/spack/packages.yaml << 'EOF'
packages:
all:
target: [x86_64]
providers:
mpi: [openmpi]
autoconf:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
automake:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
libtool:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
m4:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
openmpi:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
openssl:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
pkg-config:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
EOF
spack compiler find --scope=user
if [[ $CC == 'gcc-7' ]]; then
spack config add "packages:all:compiler:[[email protected]]"
elif [[ $CC == 'gcc-8' ]]; then
spack config add "packages:all:compiler:[[email protected]]"
elif [[ $CC == 'gcc-9' ]]; then
spack config add "packages:all:compiler:[[email protected]]"
elif [[ $CC == 'gcc-11' ]]; then
spack config add "packages:all:compiler:[[email protected]]"
else
spack config add "packages:all:compiler:[[email protected]]"
fi
spack external find
spack config add modules:prefix_inspections:lib64:[LD_LIBRARY_PATH]
spack config add modules:prefix_inspections:lib:[LD_LIBRARY_PATH]
- name: Install UnifyFS dependencies
run: |
spack install [email protected]
spack install [email protected] ^mercury~boostsys ^[email protected] fabrics=rxm,sockets,tcp
spack install spath~mpi
echo "GOTCHA_INSTALL=$(spack location -i gotcha)" >> $GITHUB_ENV
echo "SPATH_INSTALL=$(spack location -i spath)" >> $GITHUB_ENV
- name: Configure and Build
run: |
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
source $GITHUB_WORKSPACE/.spack/share/spack/setup-env.sh
spack load gotcha && spack load argobots && spack load mercury && spack load mochi-margo && spack load spath
./autogen.sh
./configure CC=$CC --with-gotcha=$GOTCHA_INSTALL --with-spath=$SPATH_INSTALL --enable-fortran
make V=1
- name: Unit Tests
run: |
source $GITHUB_WORKSPACE/.spack/share/spack/setup-env.sh
spack load gotcha && spack load argobots && spack load mercury && spack load mochi-margo && spack load spath
cd t && make check
- name: After failure
if: ${{ failure() }}
run: |
cat $GITHUB_WORKSPACE/config.log
cat $GITHUB_WORKSPACE/t/test-suite.log