format code #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: compilation-test | |
on: | |
push | |
jobs: | |
test-format: | |
runs-on: ubuntu-latest | |
env: | |
MPI_CORRECTNESS_BM_DIR: ${{ github.workspace }} | |
steps: | |
- uses: actions/checkout@v2 | |
# prerequisites | |
- run : sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev clang-format | |
- name: Check code formatting | |
run: | | |
cd $MPI_CORRECTNESS_BM_DIR/micro-benches && \ | |
export CPATH=$CPATH:./0-level/correct/include:./0-level/openmp && \ | |
for i in $(find . -type f -name "*.c"); \ | |
do echo Check code Format for $i ; \ | |
clang-format -style=file --dry-run --Werror $i;\ | |
if [[ $? -ne 0 ]]; then exit -1; fi;\ | |
done | |
test-compilation: | |
runs-on: ubuntu-latest | |
env: | |
MPI_CORRECTNESS_BM_DIR: ${{ github.workspace }} | |
steps: | |
- uses: actions/checkout@v2 | |
# prerequisites | |
- run : sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev | |
- name: Check compilation | |
run: | | |
cd $MPI_CORRECTNESS_BM_DIR/micro-benches && \ | |
export CPATH=$CPATH:./0-level/correct/include:./0-level/openmp && \ | |
for i in $(find . -type f -name "*.c"); \ | |
do echo Compiling $i ; \ | |
mpicc $i -Wall -pedantic -Wno-unused-variable -Wno-unused-but-set-variable -fopenmp -lm;\ | |
if [[ $? -ne 0 ]]; then exit -1; fi;\ | |
done |