forked from rcsb/mmtf-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (83 loc) · 2.37 KB
/
cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: "cpp"
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and test cpp
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
cc: gcc
cxx: g++
- os: ubuntu-22.04
cc: gcc
cxx: g++
env_list: EMSCRIPTEN=ON
- os: ubuntu-22.04
cc: clang
cxx: clang++
- os: ubuntu-22.04
cc: gcc
cxx: g++
cmake_args: "-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-march=native'"
- os: macos-latest
cc: clang
cxx: clang++
- os: windows-latest
cc: ''
cxx: ''
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CMAKE_ARGS: ${{ matrix.cmake_args }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
# - name: install mingw & deps
# uses: msys2/setup-msys2@v2
# with:
# update: true
# install: >-
# git
# make
# pacboy: >-
# toolchain:p
# cmake:p
# ninja:p
# if: matrix.os == 'windows-latest'
- name: Set environment list variables
run: |
env_vars="${{ matrix.env_list }}"
for var in $env_vars; do
echo "$var" >> $GITHUB_ENV
done
if: matrix.os != 'windows-latest'
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- uses: seanmiddleditch/gha-setup-ninja@master
- name: build and test
run: |
mkdir build && cd build
cmake $CMAKE_ARGS -G Ninja -Dmmtf_build_examples=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=debug ..
ninja
./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