|
17 | 17 | uses: actions/cache@v3 |
18 | 18 | with: |
19 | 19 | path: core/build-tests |
20 | | - key: ${{ runner.os }}-build-tests-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }} |
| 20 | + key: ${{ runner.os }}-build-tests-${{ hashFiles('**/CMakeLists.txt') }} |
21 | 21 |
|
22 | 22 | - name: Create build directory |
23 | 23 | run: mkdir -p core/build-tests |
@@ -60,81 +60,36 @@ jobs: |
60 | 60 | run: | |
61 | 61 | bazel run //examples/google_benchmark:my_benchmark |
62 | 62 | |
63 | | - instrumentation: |
| 63 | + cmake-integration-tests: |
64 | 64 | runs-on: ubuntu-latest |
65 | | - |
66 | | - steps: |
67 | | - - name: Checkout code |
68 | | - uses: actions/checkout@v3 |
69 | | - |
70 | | - - name: Cache build |
71 | | - uses: actions/cache@v3 |
72 | | - with: |
73 | | - path: examples/google_benchmark/build-instrumentation |
74 | | - key: ${{ runner.os }}-build-instrumentation-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }} |
75 | | - |
76 | | - - name: Create build directory |
77 | | - run: mkdir -p examples/google_benchmark/build-instrumentation |
78 | | - |
79 | | - - name: Build instrumentation benchmark example |
80 | | - run: | |
81 | | - cd examples/google_benchmark/build-instrumentation |
82 | | - cmake -DCODSPEED_MODE=instrumentation .. |
83 | | - make -j |
84 | | -
|
85 | | - - name: Run the benchmarks |
86 | | - uses: CodSpeedHQ/action@main |
87 | | - with: |
88 | | - run: examples/google_benchmark/build-instrumentation/benchmark_example |
89 | | - token: ${{ secrets.CODSPEED_TOKEN }} |
90 | | - |
91 | | - walltime: |
92 | | - runs-on: codspeed-macro |
93 | | - |
| 65 | + strategy: |
| 66 | + matrix: |
| 67 | + codspeed-mode: |
| 68 | + - "instrumentation" |
| 69 | + - "walltime" |
| 70 | + - "off" |
94 | 71 | steps: |
95 | 72 | - name: Checkout code |
96 | 73 | uses: actions/checkout@v3 |
97 | 74 |
|
98 | 75 | - name: Cache build |
99 | 76 | uses: actions/cache@v3 |
100 | 77 | with: |
101 | | - path: examples/google_benchmark/build-walltime |
102 | | - key: ${{ runner.os }}-build-walltime-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }} |
| 78 | + path: examples/google_benchmark_cmake/build |
| 79 | + key: ${{ runner.os }}-build-${{ matrix.codspeed-mode }}-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark_cmake/**') }} |
103 | 80 |
|
104 | 81 | - name: Create build directory |
105 | | - run: mkdir -p examples/google_benchmark/build-walltime |
| 82 | + run: mkdir -p examples/google_benchmark_cmake/build |
106 | 83 |
|
107 | | - - name: Build walltime benchmark example |
| 84 | + - name: Build benchmark example |
108 | 85 | run: | |
109 | | - cd examples/google_benchmark/build-walltime |
110 | | - cmake -DCODSPEED_MODE=walltime .. |
| 86 | + cd examples/google_benchmark_cmake/build |
| 87 | + cmake -DCODSPEED_MODE=${{ matrix.codspeed-mode }} .. |
111 | 88 | make -j |
112 | 89 |
|
113 | 90 | - name: Run the benchmarks |
114 | 91 | uses: CodSpeedHQ/action@main |
| 92 | + if: matrix.codspeed-mode != 'off' |
115 | 93 | with: |
116 | | - run: examples/google_benchmark/build-walltime/benchmark_example |
| 94 | + run: examples/google_benchmark/build/benchmark_example |
117 | 95 | token: ${{ secrets.CODSPEED_TOKEN }} |
118 | | - |
119 | | - |
120 | | - build-no-codspeed: |
121 | | - runs-on: ubuntu-latest |
122 | | - |
123 | | - steps: |
124 | | - - name: Checkout code |
125 | | - uses: actions/checkout@v3 |
126 | | - |
127 | | - - name: Cache build |
128 | | - uses: actions/cache@v3 |
129 | | - with: |
130 | | - path: examples/google_benchmark/build-no-codspeed |
131 | | - key: ${{ runner.os }}-build-no-codspeed-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }} |
132 | | - |
133 | | - - name: Create build directory |
134 | | - run: mkdir -p examples/google_benchmark/build-no-codspeed |
135 | | - |
136 | | - - name: Build benchmark example without codspeed |
137 | | - run: | |
138 | | - cd examples/google_benchmark/build-no-codspeed |
139 | | - cmake .. |
140 | | - make -j |
0 commit comments