forked from lvgl/lv_demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically build Emscripten versions of examples
- Loading branch information
Showing
4 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Deploy | ||
env: | ||
EM_VERSION: 1.39.18 | ||
EM_CACHE_FOLDER: 'emsdk-cache' | ||
on: | ||
push: | ||
branches: [ master ] | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '*/15 * * * *' | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
- name: Setup cache | ||
id: cache-system-libraries | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{env.EM_CACHE_FOLDER}} | ||
key: ${{env.EM_VERSION}}-${{ runner.os }} | ||
- uses: mymindstorm/setup-emsdk@v6 | ||
with: | ||
version: ${{env.EM_VERSION}} | ||
actions-cache-folder: ${{env.EM_CACHE_FOLDER}} | ||
- name: Build demo | ||
run: scripts/build_all_examples.sh ${{ env.GITHUB_SHA }} | ||
- name: Remove builder folder | ||
run: rm -rf objs/builder | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: objs # The folder the action should deploy. | ||
CLEAN: true # Automatically remove deleted files from the deploy branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
**/*.o | ||
**/*.o | ||
objs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
GIT_HASH=$1 | ||
|
||
if [ "x$GIT_HASH" == "" ]; then | ||
GIT_HASH=$(git rev-parse HEAD) | ||
fi | ||
|
||
mkdir -p objs | ||
cd objs | ||
echo "-- Updating builder ..." | ||
OBJS_DIR=`pwd` | ||
if ! [ -d builder ]; then | ||
git clone --quiet --recursive https://github.com/lvgl/lv_sim_emscripten.git builder | ||
cd builder | ||
else | ||
cd builder | ||
git pull --quiet | ||
fi | ||
cd lv_examples | ||
echo "-- Checking out lv_examples $GIT_HASH ..." | ||
git checkout $GIT_HASH | ||
cd .. | ||
echo "<html><body><h1>Choose an example:</h1><ul>" > $OBJS_DIR/index.html | ||
cat $OBJS_DIR/../scripts/examples.txt | while read -r example_name; do | ||
echo "-- Building $example_name ..." | ||
make -j4 CHOSEN_DEMO=$example_name NO_GIT_HASH=1 || exit 1 | ||
rm -rf $OBJS_DIR/$example_name | ||
cp -a build $OBJS_DIR/$example_name | ||
echo "<li><a href=\"$example_name/index.html\">$example_name</a></li>" >> $OBJS_DIR/index.html | ||
done | ||
echo "</ul></body></html>" >> $OBJS_DIR/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lv_demo_widgets | ||
lv_demo_stress |