gitout

A static git page generator
git clone https://git.bracken.jp/gitout.git
Log | Files | Refs | README | LICENSE

cmake.yml (4561B)


      1 name: CMake
      2 
      3 on:
      4   push:
      5     branches: [ master ]
      6   pull_request:
      7     branches: [ master ]
      8 
      9 jobs:
     10   build:
     11     strategy:
     12       matrix:
     13         os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
     14         type: [Debug, RelWithDebInfo, MinSizeRel, Release]
     15         compiler: [default, clang, gcc, tcc]
     16         exclude:
     17           - {os: "macos-13", compiler: "clang"}
     18           - {os: "macos-13", compiler: "gcc"}
     19           - {os: "macos-13", compiler: "tcc"}
     20           - {os: "macos-latest", compiler: "clang"}
     21           - {os: "macos-latest", compiler: "gcc"}
     22           - {os: "macos-latest", compiler: "tcc"}
     23           - {os: "ubuntu-latest", compiler: "default"}
     24           - {os: "ubuntu-latest", compiler: "default"}
     25           - {os: "windows-latest", compiler: "tcc"}
     26     runs-on: ${{ matrix.os }}
     27 
     28     steps:
     29     - uses: actions/checkout@v4
     30 
     31     - name: Create Build Environment
     32       run: cmake -E make_directory ${{github.workspace}}/build
     33 
     34     - name: Setup dependencies (Ubuntu)
     35       if: startsWith(matrix.os, 'ubuntu')
     36       run: sudo apt-get install -y gcc-10 g++-10 clang tcc
     37 
     38     - name: Setup dependencies (MinGW)
     39       if: matrix.compiler == 'gcc' && startsWith(matrix.os, 'windows')
     40       uses: e-t-l/setup-mingw@patch-1
     41 
     42     - name: Configure CMake
     43       shell: bash
     44       if: matrix.compiler == 'default'
     45       working-directory: ${{github.workspace}}/build
     46       run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=${{ matrix.type }}
     47 
     48     - name: Configure CMake with GCC (Ubuntu)
     49       shell: bash
     50       if: matrix.compiler == 'gcc' && startsWith(matrix.os, 'ubuntu')
     51       working-directory: ${{github.workspace}}/build
     52       run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
     53 
     54     - name: Configure CMake with TCC (Ubuntu)
     55       shell: bash
     56       if: matrix.compiler == 'tcc' && startsWith(matrix.os, 'ubuntu')
     57       working-directory: ${{github.workspace}}/build
     58       run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_COMPILER=tcc -DCMAKE_CXX_COMPILER=g++-10
     59 
     60     - name: Configure CMake with Clang (Ubuntu)
     61       shell: bash
     62       if: (matrix.compiler == 'clang') && startsWith(matrix.os, 'ubuntu')
     63       working-directory: ${{github.workspace}}/build
     64       run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
     65 
     66     - name: Configure CMake with MinGW
     67       shell: bash
     68       if: matrix.compiler == 'gcc' && startsWith(matrix.os, 'windows')
     69       working-directory: ${{github.workspace}}/build
     70       run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=${{ matrix.type }} -G "MinGW Makefiles" -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
     71 
     72     - name: Configure CMake with Clang (Windows)
     73       shell: bash
     74       if: (matrix.compiler == 'clang') && startsWith(matrix.os, 'windows')
     75       working-directory: ${{github.workspace}}/build
     76       run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=${{ matrix.type }} -T ClangCL
     77 
     78     - name: Build
     79       working-directory: ${{github.workspace}}/build
     80       shell: bash
     81       run: cmake --build . --config ${{ matrix.type }}
     82 
     83     - name: Test
     84       working-directory: ${{github.workspace}}/build
     85       shell: bash
     86       run: if [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.compiler }}" != "gcc" ]; then cd ${{ matrix.type }}; fi; ./utest_test
     87 
     88     - name: Test Whole Program Optimization
     89       working-directory: ${{github.workspace}}/build
     90       shell: bash
     91       run: if [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.compiler }}" != "gcc" ]; then cd ${{ matrix.type }}; fi; ./utest_test_wpo
     92 
     93     - name: Test with Multithreading
     94       working-directory: ${{github.workspace}}/build
     95       shell: bash
     96       if: startsWith(matrix.os, 'windows')
     97       run: if [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.compiler }}" != "gcc" ]; then cd ${{ matrix.type }}; fi; ./utest_test_mt
     98 
     99     - name: Test with random order
    100       working-directory: ${{github.workspace}}/build
    101       shell: bash
    102       run: if [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.compiler }}" != "gcc" ]; then cd ${{ matrix.type }}; fi; ./utest_test --random-order
    103 
    104     - name: Test with random order and seed
    105       working-directory: ${{github.workspace}}/build
    106       shell: bash
    107       run: if [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.compiler }}" != "gcc" ]; then cd ${{ matrix.type }}; fi; ./utest_test --random-order=42