-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (55 loc) · 1.42 KB
/
rust.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
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
- name: Install ALSA dev
run: |
sudo apt-get update
sudo apt-get install libasound2-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Run build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
web_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Run wasm-pack
run: wasm-pack build --target web --release
- name: Prepare the pkg folder
run: |
cp -r assets pkg/
cp web/* pkg/
rm pkg/.gitignore
- name: Deploy to web-dev branch
if: github.ref != 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: web-dev
folder: pkg
- name: Deploy to web branch
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: web
folder: pkg