Skip to content

HG Core: fix potential warnings #774

HG Core: fix potential warnings

HG Core: fix potential warnings #774

Workflow file for this run

name: CI
on:
push:
branches:
- master
paths-ignore:
- 'Documentation/**'
- 'LICENSE.txt'
- 'README.md'
pull_request:
branches:
- master
paths-ignore:
- 'Documentation/**'
- 'LICENSE.txt'
- 'README.md'
jobs:
format:
runs-on: ubuntu-latest
env:
CLANG_FORMAT_VERSION: 12
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Install package dependencies
run: sudo apt-get install -y clang-format-${{ env.CLANG_FORMAT_VERSION }}
- name: Set git configuration
run: git config --global clangFormat.binary clang-format-${{ env.CLANG_FORMAT_VERSION }}
- name: Check formatting (push to feature branch)
if: github.ref != 'refs/heads/master' && github.event_name == 'push'
run: Testing/script/gh_format.sh origin/master
- name: Check formatting (push to master branch or pull request merge)
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: Testing/script/gh_format.sh ${{ github.event.before }}
- name: Check formatting (pull request)
if: github.event_name == 'pull_request'
run: Testing/script/gh_format.sh origin/${{ github.base_ref }}
build-and-test:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
fail-fast: false
matrix:
config:
- {
os: ubuntu-latest,
cc: gcc,
cxx: g++
}
- {
os: ubuntu-latest,
cc: clang,
cxx: clang++
}
- {
os: ubuntu-latest,
cc: icc,
cxx: icpc
}
- {
os: macos-latest,
cc: clang,
cxx: clang++
}
build_type: [Debug, RelWithDebInfo, Release]
libs: [shared]
plugins: [static_plugins]
include:
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Debug
libs: static
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Asan
libs: shared
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Tsan
libs: shared
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Ubsan
libs: shared
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: RelWithDebInfo
libs: shared
plugins: dynamic_plugins
runs-on: ${{ matrix.config.os }}
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
MERCURY_BUILD_CONFIGURATION: ${{ matrix.build_type }}
MERCURY_LIBS: ${{ matrix.libs }}
MERCURY_PLUGINS: ${{ matrix.plugins }}
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
INSTALL_DIR: install
ICC_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
steps:
- name: Set up hugepages
if: runner.os == 'Linux'
run: |
sudo sh -c "echo 32 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"
grep Huge /proc/meminfo
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Setup compiler package dependencies
if: matrix.config.cc == 'icc'
run: |
Testing/script/gh_setup_intel_repo_${{ runner.os }}.sh
Testing/script/gh_get_pkg_deps_${{ runner.os }}.sh $ICC_COMPONENTS | tee icc_pkg_deps.txt
- name: Restore cached compiler package dependencies
id: cache-pkg-deps
if: matrix.config.cc == 'icc'
uses: actions/cache@v3
with:
path: |
/opt/intel/oneapi/compiler
key: ${{ runner.os }}-${{ env.ICC_COMPONENTS }}-${{ hashFiles('**/icc_pkg_deps.txt') }}-pkg-deps
- name: Install compiler package dependencies
if: matrix.config.cc == 'icc' && steps.cache-pkg-deps.outputs.cache-hit != 'true'
run: Testing/script/gh_install_pkg_deps_${{ runner.os }}.sh $ICC_COMPONENTS
- name: Install pkg-config
if: runner.os == 'macOS'
run: Testing/script/gh_install_pkg_deps_${{ runner.os }}.sh pkg-config
- name: Install MPI package dependencies
run: Testing/script/gh_install_pkg_deps_${{ runner.os }}.sh mpich
- name: Restore cached dependencies
uses: actions/cache@v3
id: cache-deps
with:
path: ${{ runner.temp }}/${{ env.INSTALL_DIR }}
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.config.cc }}-${{ hashFiles('Testing/script/gh_install_deps.sh') }}-deps
- name: Install dependencies (skip if cached)
if: steps.cache-deps.outputs.cache-hit != 'true'
run: Testing/script/gh_install_deps.sh
- name: Update
run: Testing/script/gh_ctest.sh update
- name: Configure
run: Testing/script/gh_ctest.sh configure
- name: Build
run: Testing/script/gh_ctest.sh build
- name: Test (skip for Asan/Tsan/Ubsan builds)
if: |
matrix.build_type != 'Asan' && matrix.build_type != 'Tsan' &&
matrix.build_type != 'Ubsan'
run: Testing/script/gh_ctest.sh test
- name: Coverage (Debug build only)
if: matrix.build_type == 'Debug' && matrix.config.cc == 'gcc'
run: Testing/script/gh_ctest.sh coverage
- name: Address Sanitizer (Asan build only)
if: matrix.build_type == 'Asan'
run: Testing/script/gh_ctest.sh memcheck
- name: Thread Sanitizer (Tsan build only)
if: matrix.build_type == 'Tsan'
run: Testing/script/gh_ctest.sh memcheck
- name: Undefined Behavior Sanitizer (Ubsan build only)
if: matrix.build_type == 'Ubsan'
run: Testing/script/gh_ctest.sh memcheck