-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (124 loc) · 4.35 KB
/
workflow.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
name: Build libraries & docgen
on: [push]
jobs:
libraries:
name: SP Libraries
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python environment
uses: actions/setup-python@v2
- name: Checkout generator
uses: actions/checkout@v2
with:
path: docgen
- name: Checkout SourcePawn
uses: actions/checkout@v2
with:
path: sourcepawn
repository: SlidyBat/sourcepawn
ref: enum-struct-docgen
- name: Checkout SP Submodules
shell: bash
working-directory: sourcepawn
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Checkout AMbuild
uses: actions/checkout@v2
with:
path: ambuild
repository: alliedmodders/ambuild
- name: Install AMBuild (Win/Mac)
working-directory: ambuild
if: ${{ matrix.os }} == windows-latest || ${{ matrix.os }} == macos-latest
run: |
python setup.py install
- name: Install AMBuild (Linux)
working-directory: ambuild
if: ${{ matrix.os }} == ubuntu-latest
run: |
python setup.py install --user
- name: Copy binding helpers
run: |
cp docgen/libalternator/binding/configure.py sourcepawn/
cp docgen/libalternator/binding/AMBuilder sourcepawn/exp/tools/docparse/
cp docgen/libalternator/binding/docparse.cpp sourcepawn/exp/tools/docparse/
cp docgen/libalternator/binding/docparse.h sourcepawn/exp/tools/docparse/
cp docgen/libalternator/binding/dll_exports.cpp sourcepawn/exp/compiler/
- name: Create build directory
working-directory: sourcepawn
run: |
mkdir build
- name: Build libraries
working-directory: sourcepawn/build
# env:
# CC: gcc
# CXX: g++
run: |
python ../configure.py --build exp --enable-optimize
ambuild
- name: Package libraries
working-directory: sourcepawn
run: cd build/ && tar -zcvf ../build.tar.gz * && cd -
- name: Upload libraries
uses: actions/upload-artifact@v2
with:
name: libraries-${{ matrix.os }}
path: sourcepawn/build.tar.gz
generator:
name: DocGen
needs: libraries
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout generator
uses: actions/checkout@v2
with:
path: docgen
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Download libraries
uses: actions/download-artifact@v1
with:
name: libraries-${{ matrix.os }}
path: libraries
- name: Extract libraries
run: |
mkdir docgen/libalternator/libraries
tar -xzf libraries/build.tar.gz -C docgen/libalternator/libraries
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/[email protected]
if: matrix.os == 'windows-latest'
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('docgen/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: docgen/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('docgen/Cargo.lock') }}
- name: Build crates
working-directory: docgen
run: cargo build --release
- name: Upload docgen
uses: actions/upload-artifact@v2
with:
name: docgen-${{ matrix.os }}
path: docgen/target/release/chumbucket*