Merge pull request #2088 from wsfulton/actions-gcc11
Github Actions enhancements. Adds gcc-11 testing. Refactor Github Actions by breaking up into more steps (Install Dependencies, Configure, Build, Test, Install SWIG). Fix Octave test
This commit is contained in:
commit
bfdbcdcf1a
3 changed files with 76 additions and 40 deletions
86
.github/workflows/ci.yml
vendored
86
.github/workflows/ci.yml
vendored
|
|
@ -41,6 +41,9 @@ jobs:
|
||||||
- SWIGLANG: ""
|
- SWIGLANG: ""
|
||||||
GCC: 10
|
GCC: 10
|
||||||
desc: gcc10
|
desc: gcc10
|
||||||
|
- SWIGLANG: ""
|
||||||
|
GCC: 11
|
||||||
|
desc: gcc11
|
||||||
- SWIGLANG: ""
|
- SWIGLANG: ""
|
||||||
compiler: clang
|
compiler: clang
|
||||||
desc: clang
|
desc: clang
|
||||||
|
|
@ -192,13 +195,32 @@ jobs:
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.os || 'ubuntu-20.04' }}-${{ matrix.compiler || 'gcc' }}${{ matrix.GCC }}
|
key: ${{ matrix.os || 'ubuntu-20.04' }}-${{ matrix.compiler || 'gcc' }}${{ matrix.GCC }}
|
||||||
|
|
||||||
- name: Configure
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
echo PATH="$PATH" >> $GITHUB_ENV
|
echo PATH="$PATH" >> $GITHUB_ENV
|
||||||
|
|
||||||
source Tools/GHA-linux-install.sh
|
source $GITHUB_WORKSPACE/Tools/GHA-linux-install.sh
|
||||||
|
echo WITHLANG="$WITHLANG" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
case $(uname) in
|
||||||
|
Linux)
|
||||||
|
cpu_count=$(nproc)
|
||||||
|
;;
|
||||||
|
|
||||||
|
Darwin)
|
||||||
|
cpu_count=$(sysctl -n hw.ncpu)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
cpu_count=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $cpu_count != 1 ]]; then
|
||||||
|
echo SWIGJOBS=-j$cpu_count >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
if test '${{ matrix.compiler }}' = 'clang'; then
|
if test '${{ matrix.compiler }}' = 'clang'; then
|
||||||
CC="clang"
|
CC="clang"
|
||||||
|
|
@ -219,11 +241,15 @@ jobs:
|
||||||
echo CC="$CC" >> $GITHUB_ENV
|
echo CC="$CC" >> $GITHUB_ENV
|
||||||
echo CXX="$CXX" >> $GITHUB_ENV
|
echo CXX="$CXX" >> $GITHUB_ENV
|
||||||
|
|
||||||
echo "Compiler used:"
|
|
||||||
ls -la $(which $CC) $(which $CXX)
|
ls -la $(which $CC) $(which $CXX)
|
||||||
$CC --version
|
$CC --version
|
||||||
$CXX --version
|
$CXX --version
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
source $GITHUB_WORKSPACE/Tools/CI-linux-environment.sh
|
||||||
|
|
||||||
if test -n '${{ matrix.CONFIGOPTS }}'; then
|
if test -n '${{ matrix.CONFIGOPTS }}'; then
|
||||||
CONFIGOPTS=${{ matrix.CONFIGOPTS }}
|
CONFIGOPTS=${{ matrix.CONFIGOPTS }}
|
||||||
fi
|
fi
|
||||||
|
|
@ -234,46 +260,30 @@ jobs:
|
||||||
echo "${CONFIGOPTS[@]}"
|
echo "${CONFIGOPTS[@]}"
|
||||||
./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
|
./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
|
||||||
|
|
||||||
case $(uname) in
|
|
||||||
Linux)
|
|
||||||
cpu_count=$(nproc)
|
|
||||||
;;
|
|
||||||
|
|
||||||
Darwin)
|
|
||||||
cpu_count=$(sysctl -n hw.ncpu)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
cpu_count=1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [[ $cpu_count != 1 ]]; then
|
|
||||||
echo SWIGJOBS=-j$cpu_count >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: build/build
|
working-directory: build/build
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
make $SWIGJOBS
|
make -s $SWIGJOBS
|
||||||
./swig -version && ./swig -pcreversion
|
./swig -version && ./swig -pcreversion
|
||||||
if test -z "$SWIGLANG"; then make $SWIGJOBS check-ccache; fi
|
|
||||||
if test -z "$SWIGLANG"; then make $SWIGJOBS check-errors-test-suite; fi
|
|
||||||
echo 'Installing...'
|
|
||||||
if test -z "$SWIGLANG"; then sudo make install && swig -version && ccache-swig -V; fi
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
working-directory: build/build
|
working-directory: build/build
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
|
source $GITHUB_WORKSPACE/Tools/CI-linux-environment.sh
|
||||||
|
|
||||||
|
if test -n "$CPP11"; then export CPPSTD=c++11; fi
|
||||||
|
if test -n "$CPP14"; then export CPPSTD=c++14; fi
|
||||||
|
if test -n "$CPP17"; then export CPPSTD=c++17; fi
|
||||||
|
|
||||||
|
if test -z "$SWIGLANG"; then make $SWIGJOBS check-ccache; fi
|
||||||
|
if test -z "$SWIGLANG"; then make $SWIGJOBS check-errors-test-suite; fi
|
||||||
|
|
||||||
case "$SWIGLANG" in
|
case "$SWIGLANG" in
|
||||||
javascript)
|
javascript)
|
||||||
case "$ENGINE" in
|
case "$ENGINE" in
|
||||||
node)
|
v8 | jsc)
|
||||||
export NVM_DIR="$HOME/.nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
||||||
nvm use ${VER}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# Running tests using v8 or jsc involves creating a custom
|
# Running tests using v8 or jsc involves creating a custom
|
||||||
# interpreter in Tools/javascript, which is currently broken
|
# interpreter in Tools/javascript, which is currently broken
|
||||||
# for parallel builds (we attempt to update this interpreter
|
# for parallel builds (we attempt to update this interpreter
|
||||||
|
|
@ -281,16 +291,8 @@ jobs:
|
||||||
unset SWIGJOBS
|
unset SWIGJOBS
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ruby)
|
|
||||||
source $HOME/.rvm/scripts/rvm
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
set -x
|
|
||||||
if test -n "$CPP11"; then export CPPSTD=c++11; fi
|
|
||||||
if test -n "$CPP14"; then export CPPSTD=c++14; fi
|
|
||||||
if test -n "$CPP17"; then export CPPSTD=c++17; fi
|
|
||||||
# Stricter compile flags for examples. Various headers and SWIG generated code prevents full use of -pedantic.
|
# Stricter compile flags for examples. Various headers and SWIG generated code prevents full use of -pedantic.
|
||||||
if test -n "$SWIGLANG"; then cflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cflags --std=$CSTD --compiler=$CC) && echo $cflags; fi
|
if test -n "$SWIGLANG"; then cflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cflags --std=$CSTD --compiler=$CC) && echo $cflags; fi
|
||||||
if test -n "$SWIGLANG"; then cxxflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cxxflags --std=$CPPSTD --compiler=$CC) && echo $cxxflags; fi
|
if test -n "$SWIGLANG"; then cxxflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cxxflags --std=$CPPSTD --compiler=$CC) && echo $cxxflags; fi
|
||||||
|
|
@ -299,6 +301,12 @@ jobs:
|
||||||
if test -n "$SWIGLANG"; then make $SWIGJOBS check-$SWIGLANG-examples CFLAGS="$cflags" CXXFLAGS="$cxxflags"; fi
|
if test -n "$SWIGLANG"; then make $SWIGJOBS check-$SWIGLANG-examples CFLAGS="$cflags" CXXFLAGS="$cxxflags"; fi
|
||||||
if test -n "$SWIGLANG"; then make $SWIGJOBS check-$SWIGLANG-test-suite CFLAGS="$cflags" CXXFLAGS="$cxxflags"; fi
|
if test -n "$SWIGLANG"; then make $SWIGJOBS check-$SWIGLANG-test-suite CFLAGS="$cflags" CXXFLAGS="$cxxflags"; fi
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
working-directory: build/build
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
if test -z "$SWIGLANG"; then sudo make install && swig -version && ccache-swig -V; fi
|
||||||
|
|
||||||
- name: Clean
|
- name: Clean
|
||||||
working-directory: build/build
|
working-directory: build/build
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
27
Tools/CI-linux-environment.sh
Normal file
27
Tools/CI-linux-environment.sh
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Expected to be called from elsewhere with same variables set as CI-linux-install.sh
|
||||||
|
# e.g. RETRY=travis-retry SWIGLANG=python
|
||||||
|
# Sets up environment for using various target languages
|
||||||
|
# For Github Actions where the environment is not preserved between steps
|
||||||
|
set -e # exit on failure (same as -o errexit)
|
||||||
|
|
||||||
|
case "$SWIGLANG" in
|
||||||
|
"javascript")
|
||||||
|
case "$ENGINE" in
|
||||||
|
"node")
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
|
||||||
|
nvm use ${VER}
|
||||||
|
;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"ruby")
|
||||||
|
if ! command -v rvm; then
|
||||||
|
set +x
|
||||||
|
source $HOME/.rvm/scripts/rvm
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# expected to be called from elsewhere with certain variables set
|
# Expected to be called from elsewhere with certain variables set
|
||||||
# e.g. RETRY=travis-retry SWIGLANG=python GCC=7
|
# e.g. RETRY=travis-retry SWIGLANG=python GCC=7
|
||||||
set -e # exit on failure (same as -o errexit)
|
set -e # exit on failure (same as -o errexit)
|
||||||
|
|
||||||
|
|
@ -73,6 +73,7 @@ case "$SWIGLANG" in
|
||||||
$RETRY sudo apt-get -qq install ocaml camlp4
|
$RETRY sudo apt-get -qq install ocaml camlp4
|
||||||
;;
|
;;
|
||||||
"octave")
|
"octave")
|
||||||
|
$RETRY sudo apt-get -qq update
|
||||||
$RETRY sudo apt-get -qq install liboctave-dev
|
$RETRY sudo apt-get -qq install liboctave-dev
|
||||||
;;
|
;;
|
||||||
"php")
|
"php")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue