@@ -2,55 +2,58 @@ name: build
22
33on : [push, pull_request]
44
5+ permissions :
6+ contents : read
7+
58env :
69 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
710 BUILD_TYPE : Release
811
912jobs :
10- # macos:
11- # name: macos / clang
12- # runs-on: macos-10.15
13- # env:
14- # CC: clang
15- # steps:
16- # - uses: actions/checkout@v2
17- # - name: Prepare1
18- # run: brew install gcc glib google-perftools libomp
19- # - name: Prepare2
20- # run: bash scripts/setup.sh
21- # - name: Configure CMake
22- # run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
23- # - name: build
24- # run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
25- # - name: Run
26- # continue-on-error: true
27- # run: make test
13+ macos :
14+ name : macos / clang
15+ runs-on : macos-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ - name : Prepare
19+ run : bash scripts/install_dependency.sh
20+ - name : Configure CMake
21+ run : cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
22+ - name : Build
23+ run : ninja -C ${{github.workspace}}/build
24+ - name : Test
25+ working-directory : ${{github.workspace}}/build
26+ run : ctest -C ${{env.BUILD_TYPE}} --output-on-failure --parallel
2827
2928 ubuntu :
3029 runs-on : ubuntu-latest
3130 steps :
32- - uses : actions/checkout@v2
31+ - uses : actions/checkout@v4
3332 - name : Prepare
3433 run : bash scripts/install_dependency.sh
35- - name : Configure CMake
36- run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
34+ - name : Configure CMake with LSan
35+ run : |
36+ cmake -G Ninja -B ${{github.workspace}}/build \
37+ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
38+ -DCMAKE_C_FLAGS="-fsanitize=leak" \
39+ -DCMAKE_CXX_FLAGS="-fsanitize=leak"
3740 - name : Build
38- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
39- - name : Test
41+ run : ninja -C ${{github.workspace}}/build
42+ - name : Test with LSan
4043 working-directory : ${{github.workspace}}/build
41- run : ctest -C ${{env.BUILD_TYPE}}
44+ run : |
45+ export ASAN_OPTIONS="detect_leaks=1:halt_on_error=1:verbosity=1"
46+ ctest -C ${{env.BUILD_TYPE}} --output-on-failure --parallel
4247
4348 selfhosted :
49+ if : github.repository == '1a1a11a/libCacheSim'
4450 runs-on : self-hosted
4551 steps :
46- - uses : actions/checkout@v2
52+ - uses : actions/checkout@v4
4753 - name : Configure CMake
48- run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_GLCACHE=on -DENABLE_LRB=on
54+ run : cmake -G Ninja - B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_GLCACHE=on -DENABLE_LRB=on
4955 - name : Build
50- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
56+ run : ninja -C ${{github.workspace}}/build
5157 - name : Test
5258 working-directory : ${{github.workspace}}/build
53- run : ctest -C ${{env.BUILD_TYPE}} -j
54-
55-
56-
59+ run : ctest -C ${{env.BUILD_TYPE}} --output-on-failure --parallel
0 commit comments