-
Notifications
You must be signed in to change notification settings - Fork 407
69 lines (60 loc) · 2.28 KB
/
cmake-cosmo.yml
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
# This workflow is for cmake-based build/test using Cosmo (Cosmopolitan).
name: cmake cosmo
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.os }} thr:${{ matrix.enable_threads }} single-obj:${{ matrix.single_obj_compilation }}
runs-on: ${{ matrix.os }}
timeout-minutes: 4
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ] # TODO: macos-latest, windows-latest
enable_cplusplus: [ on ]
build_type: [ Debug ]
disable_gc_debug: [ off ]
gc_assertions: [ on ]
large_config: [ on ]
enable_threads: [ off ] # TODO: on
enable_rwlock: [ off ]
single_obj_compilation: [ off, on ]
redirect_malloc: [ off ]
steps:
- uses: actions/checkout@v4
- uses: bjia56/setup-cosmocc@main
with:
version: latest
- name: Set reusable strings
# Turn repeated input strings into step outputs.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake targetting Cosmo
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
${{ matrix.cmake_generator_opt }}
-DBUILD_SHARED_LIBS=OFF
-Denable_single_obj_compilation=${{ matrix.single_obj_compilation }}
-DCMAKE_C_COMPILER=cosmocc
-DCMAKE_CXX_COMPILER=cosmoc++
-DCMAKE_AR=`type -p cosmoar`
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-Dbuild_tests=ON
-Ddisable_gc_debug=${{ matrix.disable_gc_debug }}
-Denable_cplusplus=${{ matrix.enable_cplusplus }}
-Denable_gc_assertions=${{ matrix.gc_assertions }}
-Denable_large_config=${{ matrix.large_config }}
-Denable_redirect_malloc=${{ matrix.redirect_malloc }}
-Denable_rwlock=${{ matrix.enable_rwlock }}
-Denable_threads=${{ matrix.enable_threads }}
-Denable_werror=ON
-Werror=dev
-S ${{ github.workspace }}
- name: Build
run: >
cmake --build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ matrix.build_type }} --verbose --parallel
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }} --verbose --parallel 8