diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff53b7eb..7d9910be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: bin/check_required_assets.sh diff --git a/bin/check_required_assets.sh b/bin/check_required_assets.sh new file mode 100644 index 00000000..ba9b8023 --- /dev/null +++ b/bin/check_required_assets.sh @@ -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 diff --git a/bin/required_assets.txt b/bin/required_assets.txt new file mode 100644 index 00000000..cdf00375 --- /dev/null +++ b/bin/required_assets.txt @@ -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