Skip to content

Commit

Permalink
feat(berinhard#222): checks if required assets were built in pull req…
Browse files Browse the repository at this point in the history
…uests
  • Loading branch information
pedroqueiroga committed Apr 1, 2023
1 parent 87ebb8e commit 22fb2d2
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,11 @@ jobs:
- name: Install pyp5js for dev
run: python setup.py develop --install-dir dist

- name:
- name: Execute tests
run: python -m pytest

- name: Build pyp5js
run: python3 setup.py sdist bdist_wheel

- name: Check required files
run: bash bin/check_required_assets.sh
19 changes: 19 additions & 0 deletions bin/check_required_assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

################################################################################
# Checks if required assets for pyp5js to work are present #
# #
# Created on 31/03/2023 #
################################################################################

script_path="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
required_assets=$(cat "$script_path/required_assets.txt")
semver_regex='([0-9]+)\.([0-9]+)\.([0-9]+)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\+[0-9A-Za-z-]+)?'

for asset in $required_assets; do
sanitized_asset=$(echo "$asset" | sed -r "s/$semver_regex/*/g")
if ! compgen -G "$sanitized_asset" > /dev/null; then
echo "ERROR: Required $sanitized_asset is missing in the build"
exit 1
fi
done
29 changes: 29 additions & 0 deletions bin/required_assets.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pyp5js/http_local/__init__.py
pyp5js/http_local/web_app.py
pyp5js/http_local/static/p5_reference.yml
pyp5js/http_local/static/js/ace/ace.js
pyp5js/http_local/static/js/p5/p5.js
pyp5js/http_local/static/js/p5/p5.min.js
pyp5js/http_local/static/js/p5/addons/p5.sound.js
pyp5js/http_local/static/js/p5/addons/p5.sound.min.js
pyp5js/http_local/static/js/pyodide/packages.json
pyp5js/http_local/static/js/pyodide/pyodide.asm.data
pyp5js/http_local/static/js/pyodide/pyodide.asm.js
pyp5js/http_local/static/js/pyodide/pyodide.asm.wasm
pyp5js/http_local/static/js/pyodide/pyodide.js.map
pyp5js/http_local/static/js/pyodide/pyodide_v0.18.1.js
pyp5js/http_local/static/styles/basscss-7.1.1.min.css
pyp5js/http_local/static/styles/custom.css
pyp5js/http_local/templates/base.html
pyp5js/http_local/templates/index.html
pyp5js/http_local/templates/new_sketch_form.html
pyp5js/http_local/templates/new_sketch_success.html
pyp5js/http_local/templates/view_sketch.html
pyp5js/templates/pyodide/base_sketch.py.template
pyp5js/templates/pyodide/index.html
pyp5js/templates/pyodide/target_sketch.js.template
pyp5js/templates/transcrypt/base_sketch.py.template
pyp5js/templates/transcrypt/index.html
pyp5js/templates/transcrypt/pyp5js.py
pyp5js/templates/transcrypt/python_functions.py
pyp5js/templates/transcrypt/target_sketch.py.template

0 comments on commit 22fb2d2

Please sign in to comment.