| 1 |
name: test cmake options |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ '**' ] |
| 6 |
pull_request: |
| 7 |
branches: [ '**' ] |
| 8 |
|
| 9 |
permissions: |
| 10 |
contents: read |
| 11 |
|
| 12 |
jobs: |
| 13 |
build: |
| 14 |
|
| 15 |
runs-on: ci-gcc10 |
| 16 |
if: ${{ github.repository != 'intel/pcm' }} |
| 17 |
|
| 18 |
steps: |
| 19 |
- name: Harden Runner |
| 20 |
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 |
| 21 |
with: |
| 22 |
egress-policy: audit |
| 23 |
|
| 24 |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 25 |
with: |
| 26 |
submodules: recursive |
| 27 |
|
| 28 |
- name: CMake default install |
| 29 |
run: | |
| 30 |
cmake --version |
| 31 |
rm -rf ${{ github.workspace }}/build |
| 32 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build |
| 33 |
cd ${{ github.workspace }}/build |
| 34 |
export VERBOSE=1 |
| 35 |
make install -j$(nproc) |
| 36 |
|
| 37 |
- name: CMake Release install |
| 38 |
run: | |
| 39 |
cmake --version |
| 40 |
rm -rf ${{ github.workspace }}/build |
| 41 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=Release |
| 42 |
cd ${{ github.workspace }}/build |
| 43 |
export VERBOSE=1 |
| 44 |
make install -j$(nproc) |
| 45 |
|
| 46 |
- name: CMake Debug install |
| 47 |
run: | |
| 48 |
cmake --version |
| 49 |
rm -rf ${{ github.workspace }}/build |
| 50 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=Debug |
| 51 |
cd ${{ github.workspace }}/build |
| 52 |
export VERBOSE=1 |
| 53 |
make install -j$(nproc) |
| 54 |
|
| 55 |
- name: CMake RelWithDebInfo install |
| 56 |
run: | |
| 57 |
cmake --version |
| 58 |
rm -rf ${{ github.workspace }}/build |
| 59 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 60 |
cd ${{ github.workspace }}/build |
| 61 |
export VERBOSE=1 |
| 62 |
make install -j$(nproc) |
| 63 |
|
| 64 |
- name: CMake Custom build install |
| 65 |
run: | |
| 66 |
cmake --version |
| 67 |
rm -rf ${{ github.workspace }}/build |
| 68 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_CXX_FLAGS_CUSTOM:STRING="-O2 -g" -DCMAKE_BUILD_TYPE=CUSTOM |
| 69 |
cd ${{ github.workspace }}/build |
| 70 |
export VERBOSE=1 |
| 71 |
make install -j$(nproc) |
| 72 |
|
| 73 |
- name: CMake Include systemd unit |
| 74 |
run: | |
| 75 |
cmake --version |
| 76 |
rm -rf ${{ github.workspace }}/build |
| 77 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DLINUX_SYSTEMD=TRUE -DLINUX_SYSTEMD_UNITDIR=${{ github.workspace }}/build/systemd |
| 78 |
cd ${{ github.workspace }}/build |
| 79 |
export VERBOSE=1 |
| 80 |
make install -j$(nproc) |
| 81 |
|
| 82 |
- name: CMake User-flags build install |
| 83 |
run: | |
| 84 |
cmake --version |
| 85 |
rm -rf ${{ github.workspace }}/build |
| 86 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_CXX_FLAGS="-O2 -g" |
| 87 |
cd ${{ github.workspace }}/build |
| 88 |
export VERBOSE=1 |
| 89 |
make install -j$(nproc) |
| 90 |
|
| 91 |
- name: CMake env var option build install |
| 92 |
run: | |
| 93 |
cmake --version |
| 94 |
rm -rf ${{ github.workspace }}/build |
| 95 |
export CXXFLAGS="-grecord-gcc-switches" |
| 96 |
export CFLAGS="-fstack-protector-strong" |
| 97 |
export LDFLAGS="-Wl,-z,now" |
| 98 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_CXX_FLAGS_CUSTOM:STRING="-O2 -g" -DCMAKE_BUILD_TYPE=CUSTOM |
| 99 |
cd ${{ github.workspace }}/build |
| 100 |
export VERBOSE=1 |
| 101 |
make install -j$(nproc) |
| 102 |
|
| 103 |
- name: CMake env var option build install (no custom flags) |
| 104 |
run: | |
| 105 |
cmake --version |
| 106 |
rm -rf ${{ github.workspace }}/build |
| 107 |
export CXXFLAGS="-grecord-gcc-switches" |
| 108 |
export CFLAGS="-fstack-protector-strong" |
| 109 |
export LDFLAGS="-Wl,-z,now" |
| 110 |
cmake -B ${{ github.workspace }}/build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=CUSTOM |
| 111 |
cd ${{ github.workspace }}/build |
| 112 |
export VERBOSE=1 |
| 113 |
make install -j$(nproc) |
| 114 |
|
| 115 |
- name: Diagnostic |
| 116 |
run: date |