-
Notifications
You must be signed in to change notification settings - Fork 5
116 lines (94 loc) · 3.13 KB
/
bindgen.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
name: "Bindgen"
on:
workflow_dispatch:
workflow_call:
jobs:
bindgen-ast-job:
name: "Bindgen AST"
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows, os: windows-latest, rid: win }
- { name: macOS, os: macos-latest, rid: osx }
- { name: Linux, os: ubuntu-latest, rid: linux }
steps:
- name: "Clone Git repository"
uses: actions/checkout@v2
with:
submodules: 'true'
- name: "Install CAstFfi"
shell: bash
run: dotnet tool install --global bottlenoselabs.CAstFfi.Tool
- name: "Read C code: Linux dependencies"
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu
- name: "Read C code: extract ${{ matrix.platform.rid }}"
shell: bash
run: cd ./bindgen && ./extract.sh
- name: "Upload C code platform abstract syntax trees"
uses: actions/upload-artifact@v2
with:
name: "ast-${{ matrix.platform.rid }}"
path: "./bindgen/ast"
bindgen-cross-platform-ast-job:
name: "Bindgen AST cross-platform"
needs: [bindgen-ast-job]
runs-on: ubuntu-latest
steps:
- name: "Clone Git repository"
uses: actions/checkout@v2
with:
submodules: 'false'
- name: "Download C code platform abstract syntax trees (win)"
uses: actions/download-artifact@v1
with:
name: "ast-win"
path: "./bindgen/ast"
- name: "Download C code platform abstract syntax trees (osx)"
uses: actions/download-artifact@v1
with:
name: "ast-osx"
path: "./bindgen/ast"
- name: "Download C code platform abstract syntax trees (linux)"
uses: actions/download-artifact@v1
with:
name: "ast-linux"
path: "./bindgen/ast"
- name: "Install CAstFfi"
shell: bash
run: dotnet tool install --global bottlenoselabs.CAstFfi.Tool
- name: "Generate cross-platform AST"
shell: bash
run: cd ./bindgen && ./merge.sh
- name: "Upload cross-platform AST"
uses: actions/upload-artifact@v2
with:
name: "ast-cross-platform"
path: "./bindgen/x-ast/ast-cross-platform.json"
bindgen-cs-job:
name: "Bindgen C#"
needs: [bindgen-cross-platform-ast-job]
runs-on: ubuntu-latest
steps:
- name: "Clone Git repository"
uses: actions/checkout@v2
with:
submodules: 'false'
- name: "Download C code cross-platform abstract syntax tree"
uses: actions/download-artifact@v1
with:
name: "ast-cross-platform"
path: "./bindgen/x-ast"
- name: "Install C2CS"
shell: bash
run: dotnet tool install --global bottlenoselabs.C2CS.Tool
- name: "Generate C# code"
shell: bash
run: cd ./bindgen && ./generate.sh
- name: "Upload generated C# code"
uses: actions/upload-artifact@v2
with:
name: "bindgen-cs"
path: "./src/cs/production/Interop.Sokol/Generated"