Repository navigation
89 lines (76 loc) · 2.32 KB
/
Copy pathtest.yml
File metadata and controls
89 lines (76 loc) · 2.32 KB
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
name: Build and Test
on:
pull_request:
push:
paths:
- "**.c"
- "**.h"
- "**.cpp"
- "**.hpp"
- "**/CMakeLists.txt"
- "**.cmake"
- ".github/workflows/test.yml"
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: install cmake and ninja
uses: lukka/get-cmake@v3.24.2
- name: checkout project
uses: actions/checkout@v3
- name: restore build directory cache
id: cache-build-dir
uses: actions/cache@v3
env:
cache-name: btrblocks-build-dir
with:
path: build
key: ${{ env.cache-name }}-${{ hashFiles('cmake/*.cmake') }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('test/DatasetGenerator.cpp') }}
- name: create build dir and initialize
if: ${{ steps.cache-build-dir.outputs.cache-hit != 'true' }}
run: |
mkdir -p build
cd build
cmake ..
- name: build and run dataset generator
if: ${{ steps.cache-build-dir.outputs.cache-hit != 'true' }}
run: |
cd build
make -j8 test_dataset_generator
./test_dataset_generator
test:
needs: setup
strategy:
matrix:
build-configs:
- cmake-flags: '-DCMAKE_BUILD_TYPE=Debug -DWITH_LOGGING=ON -DENABLE_FOR_SCHEME=ON'
- cmake-flags: '-DCMAKE_BUILD_TYPE=Debug -DWITH_LOGGING=OFF -DENABLE_FOR_SCHEME=OFF'
- cmake-flags: '-DCMAKE_BUILD_TYPE=Release -WITH_LOGGING=OFF -DENABLE_FOR_SCHEME=OFF'
runs-on: ubuntu-latest
steps:
- name: checkout project
uses: actions/checkout@v3
- name: restore build directory cache
id: cache-build-dir
uses: actions/cache@v3
env:
cache-name: btrblocks-build-dir
with:
path: build
key: ${{ env.cache-name }}-${{ hashFiles('cmake/*.cmake') }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('test/DatasetGenerator.cpp') }}
- name: set compiler flags
run: |
cd build
cmake ${{ matrix.build-configs.cmake-flags }} ..
- name: build btrblocks
run: |
cd build
make -j2 btrblocks
- name: build tester
run: |
cd build
make -j2 tester
- name: run tester
run: |
cd build
./tester