|
1 |
| -name: ci/action ctest |
2 |
| - |
| 1 | +name: matrix (ubuntu, macos, windows) ctes |
3 | 2 | on:
|
4 | 3 | push:
|
5 | 4 | paths-ignore:
|
6 | 5 | - docs/**
|
7 |
| - - '**.md' |
8 |
| - - '**.markdown' |
9 |
| - branches: [ master ] |
| 6 | + - "**.md" |
| 7 | + - "**.markdown" |
| 8 | + branches: |
| 9 | + - master |
10 | 10 | pull_request:
|
11 | 11 | paths-ignore:
|
12 | 12 | - docs/**
|
13 |
| - - '**.md' |
14 |
| - - '**.markdown' |
15 |
| - branches: [ master ] |
16 |
| - |
| 13 | + - "**.md" |
| 14 | + - "**.markdown" |
| 15 | + - '**.yml' |
| 16 | + branches: |
| 17 | + - master |
17 | 18 | env:
|
18 |
| - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
19 | 19 | BUILD_TYPE: Release
|
20 |
| - |
21 |
| -# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow |
22 |
| -# if you have to do a quick fix and the CI is already running your new commit will kill already |
23 |
| -# going processes before starting new ones |
24 | 20 | concurrency:
|
25 | 21 | group: ${{ github.workflow }}-${{ github.ref }}
|
26 | 22 | cancel-in-progress: true
|
27 |
| - |
28 | 23 | jobs:
|
29 | 24 | build:
|
30 | 25 | strategy:
|
31 | 26 | matrix:
|
32 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
| 27 | + os: |
| 28 | + - ubuntu-latest |
| 29 | + - macos-latest |
| 30 | + - windows-latest |
33 | 31 | runs-on: ${{ matrix.os }}
|
34 |
| - |
35 |
| - # The CMake configure and build commands are platform agnostic and should work equally |
36 |
| - # well on Windows or Mac. You can convert this to a matrix build if you need |
37 |
| - # cross-platform coverage. |
38 |
| - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
39 |
| - #runs-on: ubuntu-latest |
40 |
| - #runs-on: ${{ matrix.os }} |
41 |
| - |
42 | 32 | steps:
|
43 |
| - - uses: actions/checkout@v3 |
44 |
| - |
45 |
| - - name: Run Linux Build |
46 |
| - if: matrix.os == 'ubuntu-latest' |
47 |
| - run: echo "Ubuntu Latest" > release_ubuntu |
48 |
| - |
49 |
| - - name: Run Mac Build |
50 |
| - if: matrix.os == 'macos-latest' |
51 |
| - run: echo "MacOS Latest" > release_mac |
52 |
| - |
53 |
| - - name: Run Windows Build |
54 |
| - if: matrix.os == 'windows-latest' |
55 |
| - run: echo "Windows Latest" > release_windows |
| 33 | + # checkout full depth of history. |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + fetch-depth: 0 |
56 | 37 |
|
57 |
| - - name: Create Build Environment |
58 |
| - # Some projects don't allow in-source building, so create a separate build directory |
59 |
| - # We'll use this as our working directory for all subsequent commands |
60 |
| - run: cmake -E make_directory ${{github.workspace}}/build |
61 |
| - |
62 |
| - - name: Configure CMake |
63 |
| - # Use a bash shell so we can use the same syntax for environment variable |
64 |
| - # access regardless of the host operating system |
65 |
| - shell: bash |
66 |
| - working-directory: ${{github.workspace}}/build |
67 |
| - # Note the current convention is to use the -S and -B options here to specify source |
68 |
| - # and build directories, but this is only available with CMake 3.13 and higher. |
69 |
| - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
70 |
| - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DADD_G3LOG_UNIT_TEST=ON |
71 |
| - |
72 |
| - - name: Build |
73 |
| - working-directory: ${{github.workspace}}/build |
74 |
| - shell: bash |
75 |
| - # Execute the build. You can specify a specific target with "--target <NAME>" |
76 |
| - run: cmake --build . --config $BUILD_TYPE |
| 38 | + - name: Run Linux Build |
| 39 | + if: matrix.os == 'ubuntu-latest' |
| 40 | + run: echo "Ubuntu Latest" > release_ubuntu |
| 41 | + |
| 42 | + - name: Run Mac Build |
| 43 | + if: matrix.os == 'macos-latest' |
| 44 | + run: echo "MacOS Latest" > release_mac |
| 45 | + |
| 46 | + - name: Run Windows Build |
| 47 | + if: matrix.os == 'windows-latest' |
| 48 | + run: echo "Windows Latest" > release_windows |
| 49 | + |
| 50 | + - name: Create Build Environment |
| 51 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 52 | + |
| 53 | + - name: Configure Linux/OSX CMake |
| 54 | + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' |
| 55 | + shell: bash |
| 56 | + working-directory: ${{github.workspace}}/build |
| 57 | + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
| 58 | + -DADD_G3LOG_UNIT_TEST=ON |
77 | 59 |
|
78 |
| - - name: Test |
79 |
| - working-directory: ${{github.workspace}}/build |
80 |
| - shell: bash |
81 |
| - # Execute tests defined by the CMake configuration. |
82 |
| - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
83 |
| - run: ctest -C $BUILD_TYP |
| 60 | + - name: Configure Windows CMake |
| 61 | + if: matrix.os == 'windows-latest' |
| 62 | + shell: cmd |
| 63 | + working-directory: ${{github.workspace}}/build |
| 64 | + run: ls && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DADD_G3LOG_UNIT_TEST=ON .. |
| 65 | + |
| 66 | + - name: Build Linux/OSx |
| 67 | + working-directory: ${{github.workspace}}/build |
| 68 | + shell: bash |
| 69 | + run: cmake --build . --config $BUILD_TYPE |
84 | 70 |
|
85 |
| - - name: Fatal Exit Example |
86 |
| - working-directory: ${{github.workspace}}/build |
87 |
| - if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' || matrix.os == 'windows-latest' |
88 |
| - shell: bash |
89 |
| - # hacky / crude and effective |
90 |
| - run: ./g3log-FATAL-sigsegv || true && echo -e "\n\n=======================\n\nverifying SIGSEGV existed in stackdump\n\n\n\n" && cat /tmp/g3log*FATAL*.log | grep "SIGSEGV" |
| 71 | + - name: Test |
| 72 | + working-directory: ${{github.workspace}}/build |
| 73 | + shell: bash |
| 74 | + run: ctest -C $BUILD_TYP |
| 75 | + |
| 76 | + - name: Fatal Exit Example Linux/OSX |
| 77 | + working-directory: ${{github.workspace}}/build |
| 78 | + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' |
| 79 | + shell: bash |
| 80 | + run: ./g3log-FATAL-sigsegv || true && echo -e |
| 81 | + "\n\nverifying SIGSEGV existed in stackdump\n\n\n\n" && cat /tmp/*3log*FATAL*.log && cat /tmp/g3log*FATAL*.log | grep "SIGSEGV" |
| 82 | + |
| 83 | + - name: Fatal Exit Example Windows |
| 84 | + working-directory: ${{github.workspace}}/build |
| 85 | + if: matrix.os == 'windows-latest' |
| 86 | + shell: bash |
| 87 | + run: ./Release/g3log-FATAL-sigsegv.exe || true && echo -e "\n\nverifying SIGSEGV - EXCEPTION_ACCESS_VIOLATION existed in |
| 88 | + stackdump\n\n\n\n" && cat *3log*FATAL*.log && cat *3log*FATAL*.log | grep "EXCEPTION_ACCESS_VIOLATION" |
0 commit comments