-
Notifications
You must be signed in to change notification settings - Fork 11
111 lines (90 loc) · 2.78 KB
/
ccpp.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
name: C/C++ CI
on:
push:
branches: [ master, dev ]
pull_request:
branches: [master, dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch cache for Rust Toolchain
id: cache-rust
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust Toolchain for emscripten
run: |
rustup default nightly
rustup target add wasm32-unknown-emscripten
- name: Check cache for emscripten
id: cache-emsdk
uses: actions/cache@v2
env:
cache-name: cache-emsdk
with:
path: /tmp/emsdk
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install emscripten
if: steps.cache-emsdk.outputs.cache-hit != 'true' # Install emscripten if not found in cache
run: |
# Based on https://emscripten.org/docs/getting_started/downloads.html
cd /tmp
# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
# Enter that directory
cd emsdk
# Download and install the latest SDK tools.
./emsdk install latest
# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
# Show version
emcc --version
emcc --version
- name: Check cache for wabt
id: cache-wabt
uses: actions/cache@v2
env:
cache-name: cache-wabt
with:
path: /tmp/wabt
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install wabt
if: steps.cache-wabt.outputs.cache-hit != 'true' # Install wabt if not found in cache
run: |
cd /tmp
git clone --recursive https://github.com/WebAssembly/wabt
cd wabt
mkdir build
cd build
cmake ..
cmake --build .
- name: Build LVGL
run: |
# Add emscripten and wabt to the PATH
source /tmp/emsdk/emsdk_env.sh
export PATH=$PATH:/tmp/wabt/build
# Build LVGL app: wasm/lvgl.html, lvgl.js, lvgl.wasm
wasm/lvgl.sh
- name: Show files
run: set ; pwd ; ls -l
- name: Upload Outputs
uses: actions/upload-artifact@v2
with:
name: wasm
path: |
wasm/*.html
wasm/*.js
wasm/*.wasm
wasm/*.txt
#- name: Run tests
# run: cd tests; python ./build.py