File: build-and-test.yml

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (110 lines) | stat: -rw-r--r-- 3,429 bytes parent folder | download | duplicates (3)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: build-and-test

on:
  push: {}
  pull_request: {}

jobs:
  # TODO: add 32-bit builds (g++ and clang++) for ubuntu
  #   (requires g++-multilib and libc6:i386)
  # TODO: add coverage build (requires lcov)
  # TODO: add clang + libc++ builds for ubuntu
  # TODO: add clang + ubsan/asan/msan + libc++ builds for ubuntu
  job:
    name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.compiler }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04, macos-latest]
        build_type: ['Release', 'Debug']
        compiler: [g++, clang++]
        include:
          - displayTargetName: windows-latest-release
            os: windows-latest
            build_type: 'Release'
          - displayTargetName: windows-latest-debug
            os: windows-latest
            build_type: 'Debug'
    steps:
      - uses: actions/checkout@v2

      - name: create build environment
        run: cmake -E make_directory ${{ runner.workspace }}/_build

      - name: configure cmake
        env:
          CXX: ${{ matrix.compiler }}
        shell: bash
        working-directory: ${{ runner.workspace }}/_build
        run: >
          cmake $GITHUB_WORKSPACE
          -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
          -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

      - name: build
        shell: bash
        working-directory: ${{ runner.workspace }}/_build
        run: cmake --build . --config ${{ matrix.build_type }}

      - name: test
        shell: bash
        working-directory: ${{ runner.workspace }}/_build
        run: ctest -C ${{ matrix.build_type }} -VV

  ubuntu-14_04:
    name: ubuntu-14.04.${{ matrix.build_type }}.${{ matrix.compiler }}
    runs-on: [ubuntu-latest]
    strategy:
      fail-fast: false
      matrix:
        build_type: ['Release', 'Debug']
        compiler: [g++-4.8, clang++-3.6]
        include:
          - compiler: g++-6
            build_type: 'Debug'
            run_tests: true
          - compiler: g++-6
            build_type: 'Release'
            run_tests: true
    container: ubuntu:14.04
    steps:
      - uses: actions/checkout@v2

      - name: install required bits
        run: |
          sudo apt update
          sudo apt -y install clang-3.6 cmake3 g++-4.8 git

      - name: install other bits
        if: ${{ matrix.compiler }} == g++-6
        run: |
          sudo apt -y install software-properties-common
          sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test"
          sudo apt update
          sudo apt -y install g++-6

      - name: create build environment
        run: cmake -E make_directory $GITHUB_WORKSPACE/_build

      - name: configure cmake
        env:
          CXX: ${{ matrix.compiler }}
        shell: bash
        working-directory: ${{ github.workspace }}/_build
        run: >
          cmake $GITHUB_WORKSPACE
          -DBENCHMARK_ENABLE_TESTING=${{ matrix.run_tests }}
          -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
          -DBENCHMARK_DOWNLOAD_DEPENDENCIES=${{ matrix.run_tests }}

      - name: build
        shell: bash
        working-directory: ${{ github.workspace }}/_build
        run: cmake --build . --config ${{ matrix.build_type }}

      - name: test
        if: ${{ matrix.run_tests }}
        shell: bash
        working-directory: ${{ github.workspace }}/_build
        run: ctest -C ${{ matrix.build_type }} -VV