Skip to content

GHI #20 Setup pipelines and presets #114

GHI #20 Setup pipelines and presets

GHI #20 Setup pipelines and presets #114

Workflow file for this run

name: Run Tests With Warnings
on:
pull_request:
branches:
- "**"
jobs:
test-native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# verbose labels make things easier to read in GitHub Actions
# platform gets converted to os, preset
platform:
- windows-gcc-x86_64
- windows-msvc-x86
- windows-msvc-x64
- macos-clang-x86_64
- linux-clang-x86_64
- linux-gcc-x86_64
# build-shared gets converted to cmake option
build-shared:
- static
- shared
# convert verbose labels to usable values (which don't appear in action name)
# also just other variables that we don't want appearing in action name
include:
# use Release for everything
- cmake-build-type: Release
# platform -> os, preset
- platform: windows-gcc-x86_64
os: windows-latest
preset: patomic-ci-native-unix-gcc-warning
- platform: windows-msvc-x86
os: windows-latest
preset: patomic-ci-native-windows-msvc-warning -A Win32
- platform: windows-msvc-x64
os: windows-latest
preset: patomic-ci-native-windows-msvc-warning -A x64
- platform: macos-clang-x86_64
os: macos-latest
preset: patomic-ci-native-unix-clang-warning
- platform: linux-clang-x86_64
os: ubuntu-latest
preset: patomic-ci-native-unix-clang-warning
- platform: linux-gcc-x86_64
os: ubuntu-latest
preset: patomic-ci-native-unix-gcc-warning
# build-shared -> cmake-build-shared
- build-shared: static
cmake-build-shared: OFF
- build-shared: shared
cmake-build-shared: ON
steps:
- name: Checkout patomic
uses: actions/checkout@v4
with:
path: patomic
- name: Checkout GoogleTest
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
- name: Build and Install GoogleTest
run: |
cd googletest
cp ../patomic/CMakePresets.json .
mkdir build
cd build
cmake --preset ${{ matrix.preset }} -DCMAKE_CXX_FLAGS="" -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -Dgtest_force_shared_crt=ON -Dgtest_hide_internal_symbols=ON ..
cmake --build . --verbose --config ${{ matrix.cmake-build-type }}
cmake --install . --config ${{ matrix.cmake-build-type }} --prefix install
- name: Build patomic
run: |
cd patomic
mkdir build
cd build
cmake --preset ${{ matrix.preset }} -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DGTest_ROOT:PATH="../../googletest/build/install/lib/cmake/GTest" ..
cmake --build . --verbose --config ${{ matrix.cmake-build-type }}
- name: Test patomic
continue-on-error: true
run: |
cd patomic/build
ctest --verbose --build-config ${{ matrix.cmake-build-type }} .
- name: Prepare Test Results
run: |
mkdir upload
mkdir upload/${{ matrix.platform }}
mkdir upload/${{ matrix.platform }}/${{ matrix.build-shared }}
cp patomic/build/Testing/Temporary/* upload/${{ matrix.platform }}/${{ matrix.build-shared }}
- name: Upload Test Results
uses: actions/upload-artifact@v3
with:
name: test-warning-native-results
path: upload/
test-qemu:
runs-on: ubuntu-latest
env:
PATOMIC_CI_XARCH: ${{ matrix.architecture }}
PATOMIC_CI_XTRIPLE: ${{ matrix.triple }}
PATOMIC_CI_XCOMPILER: ${{ matrix.compiler }}
PATOMIC_CI_XCOMPILER_VERSION: ${{ matrix.compiler-version }}
strategy:
matrix:
# architecture gets converted to triple
# short form here so that it doesn't take up the whole GitHub Action name
architecture:
- aarch64
- alpha
- arm
- hppa
# fixme: m68k is supported, but ICEs clang and segfaults qemu when built with gcc (GHI #25)
# - m68k
- mips
- mips64
- mips64el
- mipsel
- ppc
- ppc64
- ppc64le
- riscv64
- s390x
# fixme: sh4 is supported (only for gcc), but segfaults qemu when built with gcc (GHI #25)
# - sh4
- sparc64
compiler:
- clang
- gcc
# build-shared gets converted to cmake option
build-shared:
- static
- shared
# exclude architectures unsupported by certain compilers
exclude:
- architecture: alpha
compiler: clang
- architecture: hppa
compiler: clang
# fixme: riscv64 is supported, but gcc errors on a system header (GHI #25)
- architecture: riscv64
compiler: gcc
- architecture: sh4
compiler: clang
# fixme: sparc64 is supported, but segfaults qemu when built with gcc (GHI #25)
- architecture: sparc64
compiler: gcc
# convert verbose labels to usable values (which don't appear in action name)
# also just other variables that we don't want appearing in action name
include:
# use Release for everything
- cmake-build-type: Release
# build-shared -> cmake-build-shared
- build-shared: static
cmake-build-shared: OFF
- build-shared: shared
cmake-build-shared: ON
# toolchain versions to use
- gcc-version: 10
- llvm-version: 15
# compiler -> preset, compiler-version
- compiler: clang
preset: patomic-ci-qemu-ubuntu-clang-warning
compiler-version: 15
- compiler: gcc
preset: patomic-ci-qemu-ubuntu-gcc-warning
compiler-version: 10
# architecture -> triple
- architecture: aarch64
triple: aarch64-linux-gnu
- architecture: alpha
triple: alpha-linux-gnu
- architecture: arm
triple: arm-linux-gnueabi
- architecture: hppa
triple: hppa-linux-gnu
# - architecture: m68k
# triple: m68k-linux-gnu
- architecture: mips
triple: mips-linux-gnu
- architecture: mips64
triple: mips64-linux-gnuabi64
- architecture: mips64el
triple: mips64el-linux-gnuabi64
- architecture: mipsel
triple: mipsel-linux-gnu
- architecture: ppc
triple: powerpc-linux-gnu
- architecture: ppc64
triple: powerpc64-linux-gnu
- architecture: ppc64le
triple: powerpc64le-linux-gnu
- architecture: riscv64
triple: riscv64-linux-gnu
- architecture: s390x
triple: s390x-linux-gnu
# - architecture: sh4
# triple: sh4-linux-gnu
- architecture: sparc64
triple: sparc64-linux-gnu
steps:
- name: Install Toolchains and Qemu
run: |
sudo apt install g++-${{ matrix.gcc-version }}-multilib
sudo apt install g++-${{ matrix.gcc-version }}-${{ matrix.triple }}
sudo apt install llvm-${{ matrix.llvm-version }}
sudo apt install clang-${{ matrix.llvm-version }}
sudo apt install qemu-user
# - name: Show what architectures clang-${{ matrix.llvm-version }} supports
# run: |
# clang-${{ matrix.llvm-version }} --print-targets
# - name: Display what was Installed
# run: |
# sudo apt update
# sudo apt-cache dumpavail | sudo dpkg --merge-avail -
# sudo apt install apt-file
# sudo apt install tree
# sudo apt-file update
# sudo apt-file list g++-${{ matrix.gcc-version }}-multilib
# sudo apt-file list g++-${{ matrix.gcc-version }}-${{ matrix.triple }}
# tree /usr/${{ matrix.triple }}
# tree /usr/lib/gcc-cross/${{ matrix.triple }}/${{ matrix.gcc-version}}
- name: Set Up Sysroot
# cannot use symlink or reference directory directly, will not work
run: |
cp -r /usr/${{ matrix.triple }}/ ${HOME}/sysroot
- name: Checkout patomic
uses: actions/checkout@v4
with:
path: patomic
- name: Checkout GoogleTest
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
- name: Build and Install GoogleTest
run: |
cd googletest
cp -r ../patomic/ci/ ./
cp ../patomic/CMakePresets.json .
mkdir build
cd build
cmake --preset ${{ matrix.preset }} -DCMAKE_CXX_FLAGS="" -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -Dgtest_force_shared_crt=ON -Dgtest_hide_internal_symbols=ON ..
cmake --build . --verbose
cmake --install . --prefix ${HOME}/sysroot
- name: Build patomic
run: |
cd patomic
mkdir build
cd build
cmake --preset ${{ matrix.preset }} -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DGTest_ROOT:PATH="${HOME}/sysroot/lib/cmake/GTest" ..
cmake --build . --verbose
- name: Test patomic
continue-on-error: true
run: |
cd patomic/build
ctest --verbose .
- name: Prepare Test Results
run: |
mkdir upload
mkdir upload/qemu-linux-${{ matrix.compiler }}-${{ matrix.architecture }}
mkdir upload/qemu-linux-${{ matrix.compiler }}-${{ matrix.architecture }}/${{ matrix.build-shared }}
cp patomic/build/Testing/Temporary/* upload/qemu-linux-${{ matrix.compiler }}-${{ matrix.architecture }}/${{ matrix.build-shared }}
- name: Upload Test Results
uses: actions/upload-artifact@v3
with:
name: test-warning-qemu-results
path: upload/