GHI #20 Setup pipelines and presets #61
Workflow file for this run
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: 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-gcc-ansi-x86_64 | |
# - windows-msvc-x86 | |
# - windows-msvc-x64 | |
# - macos-clang-x86_64 | |
# - macos-clang-ansi-x86_64 | |
# - linux-clang-x86_64 | |
# - linux-clang-ansi-x86_64 | |
# - linux-gcc-x86_64 | |
# - linux-gcc-ansi-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-gcc-ansi-x86_64 | |
# os: windows-latest | |
# preset: patomic-ci-native-unix-gcc-ansi | |
# - 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: macos-clang-ansi-x86_64 | |
# os: macos-latest | |
# preset: patomic-ci-native-unix-clang-ansi | |
# - platform: linux-clang-x86_64 | |
# os: ubuntu-latest | |
# preset: patomic-ci-native-unix-clang-warning | |
# - platform: linux-clang-ansi-x86_64 | |
# os: ubuntu-latest | |
# preset: patomic-ci-native-unix-clang-ansi | |
# - platform: linux-gcc-x86_64 | |
# os: ubuntu-latest | |
# preset: patomic-ci-native-unix-gcc-warning | |
# - platform: linux-gcc-ansi-x86_64 | |
# os: ubuntu-latest | |
# preset: patomic-ci-native-unix-gcc-ansi | |
# # 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 . --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-native-results | |
# path: upload/ | |
test-qemu: | |
runs-on: ubuntu-latest | |
env: | |
PATOMIC_CI_XTRIPLE: ${{ matrix.triple }} | |
PATOMIC_CI_XCOMPILER: ${{ matrix.compiler }} | |
PATOMIC_CI_XCOMPILER_VERSION: ${{ matrix.compiler-version }} | |
strategy: | |
matrix: | |
triple: | |
- aarch64-linux-gnu | |
compiler: | |
- clang | |
- gcc | |
# 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 | |
# 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: 11 | |
- llvm-version: 14 | |
# compiler -> preset, compiler-version | |
- compiler: clang | |
preset: patomic-ci-qemu-ubuntu-clang-warning | |
compiler-version: 14 | |
- compiler: gcc | |
preset: patomic-ci-qemu-ubuntu-gcc-warning | |
compiler-version: 11 | |
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 qemu-user | |
# - 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 . | |
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 . | |
#test-qemu: | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# # target architecture | |
# arch: | |
# - aarch64 | |
# # host compiler | |
# compiler: | |
# - gcc | |
# # - clang add later | |
# # build-shared gets converted to cmake option | |
# build-shared: | |
# # static, not needed and would slow us down | |
# - shared | |
# # add variables whose values we don't want appearing in the action name | |
# include: | |
# # use shared for everything | |
# - cmake-build-shared: ON | |
# # use Release for everything | |
# - cmake-build-type: Release | |
# # specify the toolchain versions to use | |
# - gcc-version: 11 | |
# - clang-version: 14 | |
# | |
# steps: | |
# - name: Install Cross Compiler and Qemu | |
# run: | | |
# sudo apt install g++-${{ matrix.gcc-version }}-multilib | |
# sudo apt install g++-${{ matrix.gcc-version }}-${{ matrix.arch }}-linux-gnu | |
# sudo apt install qemu-user | |
# | |
# - 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 | |
# mkdir build | |
# cd build | |
# cmake --toolchain ../../patomic/ci/toolchain-ubuntu-gcc-cross.cmake" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug .. | |
# cmake --build . | |
# cmake --install . --prefix install | |
# | |
# - name: Build patomic | |
# run: | | |
# cd patomic | |
# mkdir build | |
# cd build | |
# cmake -DCMAKE_TOOLCHAIN_FILE:PATH="../../patomic/ci/toolchain-ubuntu-gcc-cross.cmake" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug .. | |
# cmake --build . | |
# | |
# steps: | |
# - name: Install helpers | |
# run: | | |
# sudo apt update | |
# sudo apt-cache dumpavail | sudo dpkg --merge-avail - | |
# sudo apt install apt-file | |
# sudo apt-file update | |
# sudo apt install tree | |
# | |
# - name: Install stuff | |
# run: | | |
# sudo apt install gcc-11-aarch64-linux-gnu | |
# | |
# - name: Show what was installed | |
# run: | | |
# sudo apt-file list gcc-11-aarch64-linux-gnu | |
# sudo apt-file list gcc-11-multilib | |
# | |
# - name: Show contents of expected installed dirs | |
# run: | | |
# tree /usr/aarch64-linux-gnu | |
# tree /usr/lib/gcc-cross/aarch64-linux-gnu/11 | |
# | |
# - name: Compile Hello World | |
# run: | | |
# echo "int main() { printf(\"Hello, world!\n\"); }" >> test.c | |
# /usr/bin/aarch64-linux-gnu-gcc-11 test.c -o test | |
# | |
# - name: Run Hello World on QEMU | |
# run: | | |
# sudo apt install qemu-user | |
# qemu-aarch64 -L /usr/aarch64-linux-gnu ./test |