Skip to content

rwlock: Updated code formatting to better comply with general style #420

rwlock: Updated code formatting to better comply with general style

rwlock: Updated code formatting to better comply with general style #420

Workflow file for this run

name: GitHub Actions
on:
push:
branches-ignore:
- 'coverityScan'
pull_request:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
name: '${{ matrix.os.id }} (${{ matrix.compiler }}, ${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os.id }}
defaults:
run:
shell: bash
strategy:
matrix:
os:
- { id: ubuntu-20.04, name: focal }
compiler:
- 'clang-9'
- 'clang-10'
- 'clang-11'
- 'clang-12'
- 'clang-13'
- 'clang-14'
- 'clang-15'
- 'gcc-7'
- 'gcc-8'
- 'gcc-9'
- 'gcc-10'
- 'gcc-11'
cpp_std:
- 'c++11'
- 'c++14'
- 'c++17'
include:
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-6.0'
cpp_std: 'c++11'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-6.0'
cpp_std: 'c++14'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-6.0'
cpp_std: 'c++17'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-7'
cpp_std: 'c++11'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-7'
cpp_std: 'c++14'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-7'
cpp_std: 'c++17'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-8'
cpp_std: 'c++11'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-8'
cpp_std: 'c++14'
- os: { id: ubuntu-18.04, name: bionic }
compiler: 'clang-8'
cpp_std: 'c++17'
- os: { id: ubuntu-20.04, name: focal }
compiler: 'clang-15'
cpp_std: 'c++20'
- os: { id: ubuntu-20.04, name: focal }
compiler: 'gcc-11'
cpp_std: 'c++20'
## GCC6 cannot handle constexpr-ness of mmap_t
## See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297
# - os: { id: ubuntu-18.04, name: bionic }
# compiler: 'gcc-6'
# cpp_std: 'c++11'
# - os: { id: ubuntu-18.04, name: bionic }
# compiler: 'gcc-6'
# cpp_std: 'c++14'
# - os: { id: ubuntu-18.04, name: bionic }
# compiler: 'gcc-6'
# cpp_std: 'c++17'
fail-fast: false
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup GCC
if: startsWith(matrix.compiler, 'gcc')
run: |
CXX=${CC/#gcc/g++}
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install $CC $CXX gcovr
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=${CC/#gcc/gcov}" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
- name: Setup Clang
if: startsWith(matrix.compiler, 'clang')
run: |
wget https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.key
rm llvm-snapshot.gpg.key
sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os.name }}/ llvm-toolchain-${{ matrix.os.name }}${CC/#clang/} main"
sudo apt-get update
sudo apt-get install $CC gcovr
CXX=${CC/#clang/clang++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=/usr/lib/${CC/#clang/llvm}/bin/llvm-cov gcov" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
working-directory: ${{ runner.temp }}
- name: Add coverage dependency
if: matrix.compiler == 'clang-14'
run: |
apt download libclang-rt-14-dev
PACKAGE=$(find . -name 'libclang-rt-14*.deb')
sudo dpkg --install --force-breaks $PACKAGE
working-directory: ${{ runner.temp }}
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
run: |
sudo python3 -m pip install --upgrade pip setuptools wheel
sudo python3 -m pip install meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
$CC --version
$CXX --version
$GCOV --version
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'bad-alloc-heavy-industries/substrate'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
cd build
find . -type f -name '*.gcda' -exec $GCOV -p {} + > /dev/null
gcovr -r .. -x -o coverage.xml --gcov-executable "$GCOV" -e ../deps -e ../test
- name: Codecov
if: success() && github.repository == 'bad-alloc-heavy-industries/substrate'
uses: codecov/codecov-action@v3
build-windows:
name: '${{ matrix.os }} (msvc, ${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
strategy:
matrix:
os:
- windows-2019
- windows-2022
cpp_std:
- 'c++14'
- 'c++17'
include:
- os: windows-2022
cpp_std: 'c++20'
fail-fast: false
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "$HOME\\.local\\bin" >> $GITHUB_PATH
echo "GITHUB_WORKSPACE=$(pwd)" >> $GITHUB_ENV
- name: Setup compiler
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_64
- name: Install OpenCppCoverage
if: github.repository == 'bad-alloc-heavy-industries/substrate'
uses: crazy-max/ghaction-chocolatey@v2.1.0
with:
args: install OpenCppCoverage
- name: Setup OpenCppCoverage
if: github.repository == 'bad-alloc-heavy-industries/substrate'
run: |
echo "C:\Program Files\OpenCppCoverage" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
cl /Bv
link
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'bad-alloc-heavy-industries/substrate'
run: |
Remove-Item -Recurse build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
- name: Codecov
if: success() && github.repository == 'bad-alloc-heavy-industries/substrate'
uses: codecov/codecov-action@v3
build-windows-mingw:
name: '${{ matrix.os }} (${{ matrix.sys.abi }}, ${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
os:
- windows-2019
sys:
- { abi: mingw64, env: x86_64, compiler: gcc }
- { abi: ucrt64, env: ucrt-x86_64, compiler: gcc }
- { abi: clang64, env: clang-x86_64, compiler: clang }
cpp_std:
- 'c++11'
- 'c++14'
- 'c++17'
- 'c++20'
fail-fast: false
steps:
- name: Use MinGW from MSYS
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys.abi}}
update: true
path-type: inherit
install: >-
mingw-w64-${{matrix.sys.env}}-toolchain
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup compiler
if: startsWith(matrix.sys.abi, 'mingw64') || startsWith(matrix.sys.abi, 'ucrt64')
run: |
CXX=${CC/#gcc/g++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=gcov" >> $GITHUB_ENV
env:
CC: ${{ matrix.sys.compiler }}
- name: Setup compiler
if: startsWith(matrix.sys.abi, 'clang64')
run: |
CXX=${CC/#clang/clang++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=llvm-cov gcov" >> $GITHUB_ENV
env:
CC: ${{ matrix.sys.compiler }}
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
shell: bash
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
$CC --version
$CXX --version
$GCOV --version
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: ninja -C build install
- name: Run coverage build
if: github.repository == 'bad-alloc-heavy-industries/substrate'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
cd build
find . -type f -name '*.gcda' -exec $GCOV -p {} + > /dev/null
- name: Codecov
if: success() && github.repository == 'bad-alloc-heavy-industries/substrate'
uses: codecov/codecov-action@v3
build-macos:
name: '${{ matrix.os }} (${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os:
- macos-12
- macos-11
cpp_std:
- 'c++11'
- 'c++14'
- 'c++17'
fail-fast: false
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup tools
if: github.repository == 'bad-alloc-heavy-industries/substrate'
run: |
brew install gcovr
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
run: |
brew install meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
cc --version || true
ld --version || true
gcov --version || true
meson --version
ninja --version
- name: Configure
run: meson build --prefix=$HOME/.local -Db_coverage=true -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: ninja -C build install
- name: Run coverage build
if: github.repository == 'bad-alloc-heavy-industries/substrate'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
cd build
gcovr -r .. -x -o coverage.xml -e ../deps -e ../test
- name: Codecov
if: success() && github.repository == 'bad-alloc-heavy-industries/substrate'
uses: codecov/codecov-action@v3
build-macos-homebrew:
# Apple LLD is unable to link GCC < 11 generated object files.
# https://stackoverflow.com/questions/73714336/xcode-update-to-version-2395-ld-compile-problem-occurs-computedatomcount-m
# rdar://FB11369327
name: '${{ matrix.os }} (homebrew, ${{ matrix.compiler }}, ${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os:
- macos-11
compiler:
## GCC5 cannot compile anything on macOS
# - gcc@5
## GCC6 cannot handle constexpr-ness of mmap_t
## See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297
# - gcc@6
- gcc@7
- gcc@8
- gcc@9
- gcc@10
- gcc@11
- gcc
cpp_std:
- 'c++11'
- 'c++14'
- 'c++17'
include:
- os: macos-11
compiler: gcc
cpp_std: 'c++20'
fail-fast: false
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup compiler
run: |
brew install ${{ matrix.compiler }} gcovr
CC=${COMPILER/@/-}
CXX=${CC/#gcc/g++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=${CC/#gcc/gcov}" >> $GITHUB_ENV
env:
COMPILER: ${{ matrix.compiler }}
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
run: |
brew install meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
shell: bash
run: |
$CC --version
$CXX --version
$GCOV --version
meson --version
ninja --version
- name: Configure
run: meson build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: ninja -C build install
- name: Run coverage build
if: github.repository == 'bad-alloc-heavy-industries/substrate'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
cd build
gcovr -r .. -x -o coverage.xml --gcov-executable "$GCOV" -e ../deps -e ../test
- name: Codecov
if: success() && github.repository == 'bad-alloc-heavy-industries/substrate'
uses: codecov/codecov-action@v3