-
Notifications
You must be signed in to change notification settings - Fork 5
151 lines (142 loc) · 4.35 KB
/
ci.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
name: Continuous Integration
on:
pull_request:
push:
branches:
- master
env:
DEFAULT_CRATE_NAME: wasmer_pack
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
MDBOOK_VERSION: v0.4.21
RUST_LOG: info
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Compile and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Non-Rust Cache
uses: actions/cache@v3
with:
path: |
**/generated_bindings/
**/node_modules/
key: non-rust-cache
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "1.2.2"
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Pipenv
run: pip install --user pipenv
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v1
- name: setup rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install cargo-wasmer
run: |
cargo install cargo-wasmer --verbose --debug --version '^0.4'
- name: Type Checking
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --verbose --locked
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --verbose --locked
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --verbose --locked
workflow-times:
name: Workflow Timings
runs-on: ubuntu-latest
needs: check
steps:
- name: Time Reporter
uses: Michael-F-Bryan/workflow-timer@v0.2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
jobs: |
Compile and Test
message: |
Make sure you keep an eye on build times!
One of this project's goals is to [keep CI runs under 5 minutes][goal] so developers can maintain fast edit-compile-test cycles.
[goal]: https://github.com/wasmerio/wasmer-pack/blob/bdfd5c9483821651cf0bbd70189fc04416bc22b1/CONTRIBUTING.md#goal-1-fast-compile-times
lints:
name: Linting and Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: setup rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Check Formatting
run: |
cargo fmt --all --verbose --check
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --verbose
api-docs:
name: Publish API Docs to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install mdbook
run: |
mkdir bin
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/${{ env.MDBOOK_VERSION }}/mdbook-${{ env.MDBOOK_VERSION }}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=bin
echo "PATH=$(pwd)/bin:$PATH" >> $GITHUB_ENV
- name: User Docs
run: mdbook build
working-directory: doc
- name: setup rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: API Docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --verbose --locked
- name: Redirect top-level GitHub Pages
run: 'echo ''<meta http-equiv="refresh" content="0; url=${{ env.DEFAULT_CRATE_NAME }}/index.html" />'' > target/doc/index.html'
shell: bash
- name: Rearrange Docs Directory
run: |
mkdir public
mv target/doc public/api-docs
mv doc/book/html public/user-docs
- name: Upload API Docs
uses: JamesIves/github-pages-deploy-action@v4.4.0
if: github.ref == 'refs/heads/master'
with:
branch: gh-pages
folder: public
single-commit: true