-
Notifications
You must be signed in to change notification settings - Fork 21
73 lines (67 loc) · 2.45 KB
/
build.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
name: Rust
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
x86-64-linux-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: desktop-${{ runner.os }}-linux-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get clean && sudo apt-get update
sudo apt-get install -y pkg-config libudev-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev libasound2-dev libgtk-3-dev
- uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --target x86_64-unknown-linux-gnu --verbose
- name: Run tests
run: cargo test --target x86_64-unknown-linux-gnu --verbose
wasm32-build-and-serve:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: web-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1
- uses: dtolnay/rust-toolchain@stable
- run: command -v wasm-pack >/dev/null 2>&1 || cargo install --force --git https://github.com/rustwasm/wasm-pack.git --tag v0.13.1
# https://github.com/rustwasm/wasm-bindgen/issues/4211
- run: cargo install --force wasm-bindgen-cli --git "https://github.com/rustwasm/wasm-bindgen"
- name: Install wasm Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get clean && sudo apt-get update
sudo apt-get install -y pkg-config libudev-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev
- name: Install node dependencies
run: (cd www && npm install)
- name: Build and publish
run: ./.github/publish.sh
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages
folder: www/dist/
single_commit: true