Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cmake.yml « workflows « .github - github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a2a9063726d9a54fd459d88ba2023a0da3d17530 (plain)
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
name: CMake

on:
  push:
    branches: [ master, main ]
  pull_request:
    branches: [ master, main ]
  workflow_dispatch:

env:
  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  BUILD_TYPE: Release


defaults:
  run:
    shell: bash

jobs:
  build-ubuntu:
    strategy:
      matrix:
        os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
        compiler: [ g++-9, g++-10, clang++ ]
        include:
          - os: ubuntu-18.04
            compiler: g++-7
    name: Build and Test on Ubuntu
    runs-on: ${{matrix.os}}
    steps:
      - uses: actions/checkout@v3
      - name: Configure CMake
        run: cmake -S "${{github.workspace}}" -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=${{matrix.compiler}}
      - name: Build
        run: cmake --build "${{github.workspace}}/build" --config $BUILD_TYPE
      - name: Test
        working-directory: ${{github.workspace}}/build/test
        run: ctest -C $BUILD_TYPE --output-on-failure

  build-macos:
    name: Build and Test on MacOS
    strategy:
      matrix:
        os: [ macos-11, macos-12 ]
    runs-on: ${{matrix.os}}
    steps:
      - uses: actions/checkout@v3
      - name: Configure CMake
        run: cmake -S "${{github.workspace}}" -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
      - name: Show compile commands
        run: cat build/compile_commands.json
      - name: Build
        run: cmake --build "${{github.workspace}}/build" --config $BUILD_TYPE
      - name: Test
        working-directory: ${{github.workspace}}/build/test
        shell: bash
        run: ctest -C $BUILD_TYPE --output-on-failure

  build-windows:
    name: Build and Test on Windows
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ilammy/msvc-dev-cmd@v1
      - name: Configure CMake
        run: cmake -S "${{github.workspace}}" -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -T "ClangCl"
      - name: Build
        run: cmake --build "${{github.workspace}}/build" --config $BUILD_TYPE
      - name: Test
        working-directory: ${{github.workspace}}/build/test
        run: cd $BUILD_TYPE && ./link_test && ./options_test