-
Notifications
You must be signed in to change notification settings - Fork 5
173 lines (147 loc) · 4.51 KB
/
build_artifacts.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
name: build_artifacts
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_linux:
strategy:
matrix:
target: [armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu, aarch64-linux-android, x86_64-linux-android]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Cache build dependencies
uses: actions/cache@v2
with:
key: runecoral-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
target
Cargo.lock
.cache
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo Install cross
uses: actions-rs/cargo@v1
with:
command: install
args: cross
- name: Cross Test
run: cross test --target ${{ matrix.target }}
build_windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
Cargo.lock
.cache
key: runecoral-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install Build Dependencies
run: |
pip install numpy
- name: Build librunecoral
env:
BAZEL_VC: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC
run: |
mkdir -p dist/include
mkdir -p dist/lib/windows/x86_64/
bazel --batch --output_base .cache/bazel build --config windows //runecoral:runecoral
cp runecoral/runecoral.h dist/include
cp bazel-bin/runecoral/runecoral.lib dist/lib/windows/x86_64/
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# libclang is needed by bindgen
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- name: Cargo Check
uses: actions-rs/cargo@v1
env:
RUNECORAL_DIST_DIR: "${{ github.workspace }}/dist/"
with:
command: check
- name: Cargo Test
uses: actions-rs/cargo@v1
env:
RUNECORAL_DIST_DIR: "${{ github.workspace }}/dist/"
with:
command: test
- name: Use GNU Tar from Msys
run: |
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
rm C:\msys64\usr\bin\bash.exe
build_apple:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Cache build dependencies
uses: actions/cache@v2
with:
key: runecoral-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
target
Cargo.lock
.cache
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup bazel
uses: jwlawson/actions-setup-bazel@v1
with:
bazel-version: '3.7.2'
- uses: actions/setup-python@v2
with:
python-version: '3.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Install build dependencies
run: |
pip install numpy
- name: Build packages
run: |
make runecoral_header
make librunecoral-apple BAZEL="bazel --batch --output_base=$PWD/.cache"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo Check
uses: actions-rs/cargo@v1
env:
RUNECORAL_DIST_DIR: "${{ github.workspace }}/dist/"
with:
command: check
- name: Cargo Test
uses: actions-rs/cargo@v1
env:
RUNECORAL_DIST_DIR: "${{ github.workspace }}/dist/"
with:
command: test