forked from y-crdt/y-crdt
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (88 loc) · 2.54 KB
/
main.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
name: Main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build-yrs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- name: checkout sources
uses: actions/checkout@v2
- name: install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: build default
run: cargo build --verbose --release -p yrs -p yffi
test-yrs:
runs-on: ${{ matrix.os }}
needs: build-yrs
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- name: checkout sources
uses: actions/checkout@v2
- name: install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: build default
run: cargo test --release --all-features -p yrs -p yffi
wasm:
runs-on: ubuntu-latest
needs: build-yrs
steps:
- name: checkout sources
uses: actions/checkout@v2
- name: install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: install nodejs
uses: actions/setup-node@v2
with:
node-version: '16'
- name: install wasm-pack
uses: jetli/[email protected]
with:
version: 'latest'
- name: build wasm
run: wasm-pack build --release --target nodejs ./ywasm
- name: test web assembly
run: cd ./tests-wasm && npm i && npm test
c-ffi:
runs-on: ubuntu-latest
needs: build-yrs
steps:
- name: checkout sources
uses: actions/checkout@v2
- name: install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: install cbindgen
run: cargo install cbindgen
- name: generate C bindings
run: cbindgen --config ./yffi/cbindgen.toml --crate yffi --output ./tests-ffi/include/libyrs.h --lang C
- name: install cmake
uses: lukka/get-cmake@latest
- name: build libyrs
run: cargo build -p yffi
- name: generate Makefile
run: mkdir ./tests-ffi/cmake-build-debug && cd ./tests-ffi && cmake -DCMAKE_BUILD_TYPE=Debug .
- name: build c-ffi test project
run: cd ./tests-ffi && make all
- name: run tests
run: ./tests-ffi/yrs-ffi-tests