forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (105 loc) · 4.68 KB
/
wasm_demos.yaml
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
# Copyright © SixtyFPS GmbH <[email protected]>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
name: Build wasm demos
on:
workflow_dispatch:
workflow_call:
inputs:
rustflags:
type: string
description: extra rustflags
jobs:
wasm_demo:
env:
CARGO_PROFILE_RELEASE_OPT_LEVEL: s
CARGO_INCREMENTAL: false
RUSTFLAGS: ${{ github.event.inputs.rustflags || inputs.rustflags }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust
with:
target: wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Gallery WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
export SLINT_STYLE=fluent && wasm-pack build --release --out-dir pkg/fluent --target web
export SLINT_STYLE=material && wasm-pack build --release --out-dir pkg/material --target web
export SLINT_STYLE=cupertino && wasm-pack build --release --out-dir pkg/cupertino --target web
export SLINT_STYLE=cosmic && wasm-pack build --release --out-dir pkg/cosmic --target web
working-directory: examples/gallery
- name: Printer demo WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/printerdemo/rust
- name: Printer demo old WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/printerdemo_old/rust
- name: Todo demo WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/todo/rust
- name: Carousel demo WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/carousel/rust
- name: Sliding Puzzle demo WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/slide_puzzle
- name: Memory example WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/memory
- name: Imagefilter example WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/imagefilter/rust
- name: Plotter example WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/plotter
- name: OpenGL underlay example WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web
working-directory: examples/opengl_underlay
- name: Energy Monitor example WASM build
run: |
sed -i "s/#wasm# //" Cargo.toml
wasm-pack build --release --target web --no-default-features --features slint/default,chrono
working-directory: examples/energy-monitor
- name: "Upload Demo Artifacts"
uses: actions/upload-artifact@v4
with:
name: wasm_demo
path: |
examples/gallery/
examples/printerdemo/rust/
examples/printerdemo_old/rust/
examples/todo/
examples/carousel/rust/
examples/memory/
examples/slide_puzzle/
examples/imagefilter/rust
examples/plotter/
examples/opengl_underlay/
examples/energy-monitor/
!/**/.gitignore
- name: Clean cache # Otherwise the cache is much too big
run: |
du -hs target
rm -rf target/*/incremental
rm -rf target/*/*/*slint*
du -hs target