-
Notifications
You must be signed in to change notification settings - Fork 14
183 lines (180 loc) · 6.37 KB
/
build-macos.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: Build (macOS)
on:
workflow_dispatch:
inputs:
build-type:
description: build in release or debug
required: true
default: Debug
type: choice
options:
- Debug
- Release
runtime-tests:
description: Run the runtime tests?
required: true
default: false
type: boolean
run-tests:
description: Run the tests?
required: false
default: false
type: boolean
rust-cache:
description: Use existing rust cache?
required: false
default: false
type: boolean
workflow_call:
inputs:
build-type:
required: true
default: Debug
type: string
runtime-tests:
required: true
default: false
type: boolean
run-tests:
required: false
default: false
type: boolean
rust-cache:
required: false
default: true
type: boolean
jobs:
#
# Build shards for macOS
#
macOS:
name: Build (${{ github.event.inputs.build-type || inputs.build-type }})
runs-on: macos-latest
outputs:
run-tests: ${{ steps.setup.outputs.run-tests }}
artifact-name: shards-macos ${{ steps.setup.outputs.build-type }}
steps:
- name: Setup
id: setup
shell: bash
run: |
echo "build-type=${{ github.event.inputs.build-type || inputs.build-type }}" >> $GITHUB_OUTPUT
echo "runtime-tests=${{ github.event.inputs.runtime-tests || inputs.runtime-tests }}" >> $GITHUB_OUTPUT
echo "run-tests=${{ github.event.inputs.run-tests || inputs.run-tests }}" >> $GITHUB_OUTPUT
echo "rust-cache=${{ github.event.inputs.rust-cache || inputs.rust-cache }}" >> $GITHUB_OUTPUT
- name: Checkout shards
uses: actions/checkout@v3
with:
repository: fragcolor-xyz/shards
fetch-depth: 1
submodules: recursive
- name: Set up dependencies
run: |
sudo xcode-select --switch /Applications/Xcode_15.4.app
brew install cmake ninja clang-format
./bootstrap
RUSTUP_TOOLCHAIN=`cat rust.version`
echo "RUSTUP_TOOLCHAIN=$RUSTUP_TOOLCHAIN" >> $GITHUB_ENV
rustup toolchain install $RUSTUP_TOOLCHAIN
- uses: Swatinem/rust-cache@v2
if: ${{ steps.setup.outputs.rust-cache == 'true' }}
with:
key: ${{ steps.setup.outputs.build-type }}
- name: Build
run: |
mkdir build
cd build
cmake -G Ninja -DSPDLOG_ACTIVE_LEVEL="SPDLOG_LEVEL_DEBUG" -DSHARDS_DEFAULT_LOG_LEVEL="SPDLOG_LEVEL_DEBUG" -DSKIP_HEAVY_INLINE=1 -DWITH_SQLITE_VEC=ON -DCMAKE_BUILD_TYPE=${{ steps.setup.outputs.build-type }} -DSHARDS_THREAD_FIBER=ON -DUSE_ASAN=ON -DTRACY_ENABLE=ON -DTRACY_TIMER_FALLBACK=ON ..
ninja shards
- name: Test runtime (Debug)
if: ${{ steps.setup.outputs.runtime-tests == 'true' && steps.setup.outputs.build-type == 'Debug' }}
env:
RUST_BACKTRACE: full
run: |
cd build
ninja test-runtime
./test-runtime
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: shards-macos ${{ steps.setup.outputs.build-type }}
path: build/shards
if-no-files-found: error
retention-days: 1
#
# Test shards on macOS
#
macOS-test:
if: ${{ needs.macOS.outputs.run-tests == 'true' }}
needs: macOS
name: Test
runs-on: macos-latest
steps:
- name: Setup
id: setup
run: |
echo "build-type=${{ github.event.inputs.build-type || inputs.build-type }}" >> $GITHUB_OUTPUT
- name: Checkout shards
uses: actions/checkout@v3
with:
repository: fragcolor-xyz/shards
fetch-depth: 1
submodules: true
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ needs.macOS.outputs.artifact-name }}
path: build
- name: Test
env:
RUST_BACKTRACE: full
run: |
cd build
chmod +x shards
./shards new ../shards/tests/general.shs
./shards new ../shards/tests/zip-map.shs
./shards new ../shards/tests/strings.shs
./shards new ../shards/tests/table-compose.shs
./shards new ../shards/tests/variables.shs
./shards new ../shards/tests/subwires.shs
./shards new ../shards/tests/linalg.shs
./shards new ../shards/tests/network.shs
./shards new ../shards/tests/network-ws.shs
./shards new ../shards/tests/struct.shs
./shards new ../shards/tests/flows.shs
./shards new ../shards/tests/kdtree.shs
./shards new ../shards/tests/channels.shs
./shards new ../shards/tests/imaging.shs
./shards new ../shards/tests/http.shs
./shards new ../shards/tests/bigint.shs
./shards new ../shards/tests/brotli.shs
./shards new ../shards/tests/snappy.shs
./shards new ../shards/tests/expect.shs
./shards new ../shards/tests/wasm.shs
./shards new ../shards/tests/rust.shs
./shards new ../shards/tests/crypto.shs
./shards new ../shards/tests/wire-macro.shs
./shards new ../shards/tests/branch.shs
./shards new ../shards/tests/audio.shs test-device:false
./shards new ../shards/tests/audio2.shs test-device:false
./shards new ../shards/tests/events.shs
./shards new ../shards/tests/complex-deserialize.shs
./shards new ../shards/tests/db.shs with-sqlite-vec:true
./shards new ../shards/tests/suspend-resume.shs
./shards new ../shards/tests/help.shs
./shards new ../shards/tests/whendone.shs
./shards new ../shards/tests/return.shs
./shards new ../shards/tests/table-seq-push.shs
./shards new ../shards/tests/failures.shs
./shards new ../shards/tests/traits.shs
./shards new ../shards/tests/llm.shs
- name: Test doc samples (non-UI)
env:
RUST_BACKTRACE: full
run: |
cd docs/samples
for i in $(find shards -name '*.edn' \( ! -path '*UI*' ! -path '*GFX*' ! -path '*Dialog*' \));
do
echo "Running sample $i";
../../build/shards run-sample.edn --file "$i";
done