cmake bs #20
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: "cpp" | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build and test cpp | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
cc: gcc | |
cxx: g++ | |
shell: bash | |
- os: ubuntu-18.04 | |
cc: gcc-4.8 | |
cxx: g++-4.8 | |
shell: bash | |
env_list: ARCH=x86 | |
- os: ubuntu-22.04 | |
cc: gcc | |
cxx: g++ | |
shell: bash | |
env_list: EMSCRIPTEN=ON | |
- os: ubuntu-22.04 | |
cc: clang | |
cxx: clang++ | |
shell: bash | |
- os: ubuntu-22.04 | |
cc: gcc | |
cxx: g++ | |
shell: bash | |
cmake_args: "-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-march=native'" | |
- os: macos-latest | |
cc: clang | |
cxx: clang++ | |
shell: bash | |
- os: windows-latest | |
cc: gcc | |
cxx: g++ | |
shell: 'msys2 {0}' | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: ${{ matrix.shell }} | |
env: | |
CC: ${{ matrix.cc }} | |
CXX: ${{ matrix.cxx }} | |
ARCH: ${{ matrix.arch }} | |
CMAKE_ARGS: ${{ matrix.cmake_args }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set environment list variables | |
run: | | |
env_vars="${{ matrix.env_list }}" | |
for var in $env_vars; do | |
echo "$var" >> $GITHUB_ENV | |
done | |
- name: Set CMAKE_GENERATOR for Windows | |
if: matrix.os == 'windows-latest' | |
run: echo "CMAKE_GENERATOR=MinGW Makefiles" >> $GITHUB_ENV | |
- name: install mingw & deps | |
uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: >- | |
cmake | |
if: matrix.os == 'windows-latest' | |
- name: Install Dependencies | |
run: | | |
if [[ "${{ matrix.env_list }}" = "ARCH=x86" ]]; then | |
sudo apt-get update | |
sudo apt-get install gcc-4.8 g++-4.8 g++-4.8-multilib linux-libc-dev:i386 libc6-dev-i386 | |
fi | |
if: matrix.os != 'windows-latest' | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.16.x' | |
- name: build and test | |
run: | | |
mkdir build && cd build | |
cmake $CMAKE_ARGS -Dmmtf_build_examples=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=debug .. | |
make -j2 | |
echo "lol" | |
ls | |
ls * | |
./tests/mmtf_tests | |
./tests/multi_cpp_test | |
./examples/mmtf_demo ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf | |
./examples/traverse ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf | |
./examples/traverse ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf json | |
./examples/traverse ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf print | |
./examples/print_as_pdb ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf | |