-
Notifications
You must be signed in to change notification settings - Fork 15
162 lines (157 loc) · 5.31 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
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
name: Continuous integration
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: Compile and Test
strategy:
matrix:
os:
- ubuntu-18.04
- macos-latest
# Note: we need to use pre-compiled TensorFlow Lite binaries on
# Windows, so ignore the Windows build for now
#- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ github.workflow }}-${{ github.job }}
- name: Update Rustup
run: |
# We need to update rustup because the mac version is out of date and
# self-update is disabled. https://github.com/rust-lang/rustup/issues/2766
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
if: runner.os == 'macOS'
- name: Setup bazel
uses: jwlawson/actions-setup-bazel@v1
with:
bazel-version: '3.7.2'
- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: latest-stable
- uses: actions/setup-python@v2
if: runner.os == 'macOS'
with:
python-version: "3.6"
- name: Install build dependencies
if: runner.os == 'macOS'
run: |
pip install numpy
pip3 install numpy
- name: Setup Rust
run: rustup show
- name: Type Check
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --verbose --locked --all-features
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --verbose --locked --all-features
- name: Unit Tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --verbose --locked --all-features
- name: Integration Tests
uses: actions-rs/cargo@v1
with:
command: integration-tests
api-docs:
name: Generate API Docs
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ github.workflow }}-${{ github.job }}
- uses: actions/setup-python@v2
with:
python-version: "3.6"
- name: Update Rustup
run: |
# We need to update rustup because the mac version is out of date and
# self-update is disabled. https://github.com/rust-lang/rustup/issues/2766
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
if: runner.os == 'macOS'
- name: Setup Rust
run: rustup show
- name: Generate API Docs
id: first_try
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: doc
args: --workspace --verbose --locked
# Sometimes generating docs on GitHub actions will spuriously fail with
# a random "file not found" error - possibly due to caching - so we try
# twice before failing the build.
#
# error: failed to remove file `/home/runner/work/rune/rune/target/doc/rune/constant.DEFAULT_RUST_LOG.html`
# Caused by:
# No such file or directory (os error 2)
- name: Generate API Docs (second attempt)
run: |
cargo clean --doc
cargo doc --workspace --verbose --locked
if: ${{ steps.first_try.outcome == 'failure' }}
- name: Create the Output Directory
run: |
mkdir -p public
cp -r target/doc public/crate-docs
- name: Automatically redirect to rune_runtime docs
run: echo '<meta http-equiv="refresh" content="0; url=crate-docs/hotg_rune_core/index.html" />' > public/index.html
- name: Generate HTML docs from JSON Schema
run: |
pip3 install json-schema-for-humans
mkdir -p public/schema
generate-schema-doc crates/compiler/runefile-schema.json public/schema/schema.html --copy-css --copy-js --expand-buttons
- name: Upload API Docs
uses: JamesIves/github-pages-deploy-action@4.1.1
if: github.ref == 'refs/heads/master'
with:
branch: gh-pages
folder: public
web-bindings:
name: Test Web Bindings
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
bindings/web/node_modules
key: ${{ runner.os }}-${{ github.workflow }}-${{ github.job }}
- name: Setup Rust
run: rustup show
- name: check @hotg-ai/rune
run: yarn install && yarn build && yarn test
working-directory: bindings/web/rune
- name: check @hotg-ai/rune-tfjs-v3
run: yarn install && yarn build && yarn test
working-directory: bindings/web/tfjs-v3
- name: check @hotg-ai/rune-tfjs-v2
run: yarn install && yarn build
working-directory: bindings/web/tfjs-v2
- name: check @hotg-ai/rune-tflite
run: yarn install && yarn build
working-directory: bindings/web/tflite