-
Notifications
You must be signed in to change notification settings - Fork 73
129 lines (111 loc) · 3.29 KB
/
Copy pathcbindings.yml
File metadata and controls
129 lines (111 loc) · 3.29 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
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
name: C bindings examples
on:
push:
branches:
- master
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
c-bindings:
timeout-minutes: 30
strategy:
fail-fast: false
env:
NIMBLE_COMMIT: 9207e8b2bbdf66b5a4d1020214cff44d2d30df92 # v0.20.1
defaults:
run:
shell: bash
name: "Build C bindings"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Setup Nim
uses: "./.github/actions/install_nim"
with:
shell: bash
os: linux
cpu: amd64
nim_ref: v2.2.10
- name: Restore deps from cache
id: deps-cache
uses: actions/cache@v5
with:
path: nimbledeps
# Keep this in sync with ci.yml's cache key so entries are
# reusable. See ci.yml for the rationale on os/cpu/cc scoping.
key: nimbledeps-linux-amd64-gcc-${{ hashFiles('.pinned') }}
- name: Install deps
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: |
nimble install_pinned
- name: Build and run c bindings examples
run: |
nim --version
nimble --version
gcc --version
nimble setup
cd cbind
nimble install_pinned
nimble setup
nimble examples
# Temporary parallel job: builds the new nim-ffi library (cbind/libp2p_ffi.nim)
# and generates its C/CDDL bindings. Folded into the main flow at the flip PR,
# when libp2p_ffi.nim replaces the legacy libp2p.nim.
#
# Disabled until the final PR of the nim-ffi migration series: libp2p_ffi.nim is
# built up incrementally across PRs 2..9 and only compiles end-to-end at the
# flip. Re-enable (drop `if: false`) once the library is complete and expected
# to pass.
c-bindings-ffi:
if: false
timeout-minutes: 30
strategy:
fail-fast: false
env:
NIMBLE_COMMIT: 9207e8b2bbdf66b5a4d1020214cff44d2d30df92 # v0.20.1
defaults:
run:
shell: bash
name: "Build FFI library (nim-ffi)"
runs-on: macos-15 # fastest to compile and run; see daily_test_all_no_flags.yml
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Setup Nim
uses: "./.github/actions/install_nim"
with:
shell: bash
os: macos-15
cpu: arm64
nim_ref: v2.2.10
- name: Restore deps from cache
id: deps-cache
uses: actions/cache@v5
with:
path: nimbledeps
key: nimbledeps-macos-15-arm64-clang-${{ hashFiles('.pinned', 'cbind/.pinned') }}
- name: Install deps
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: |
nimble install_pinned
- name: Build FFI library and generate C/CDDL bindings
run: |
nim --version
nimble --version
clang --version
nimble setup
cd cbind
nimble install_pinned
nimble setup
nimble buildffi
nimble genbindings_c
nimble genbindings_cddl