diff --git a/.github/workflows/check_export.yml b/.github/workflows/check_export.yml new file mode 100644 index 00000000..ac29b6c1 --- /dev/null +++ b/.github/workflows/check_export.yml @@ -0,0 +1,68 @@ +name: check-export +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + list-examples: + runs-on: ubuntu-latest + outputs: + examples: ${{ steps.generate-matrix.outputs.examples }} + steps: + - uses: actions/checkout@v3 + - name: Generate Matrix + id: generate-matrix + run: | + # TODO fix sales export + EXAMPLES="$(ls -1 | grep -vw sales | jq -R | jq -s -c)" + echo $EXAMPLES + echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT + + check-export: + needs: [list-examples] + strategy: + matrix: + example: ${{ fromJSON(needs.list-examples.outputs.examples) }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - run: | + f=${{ matrix.example }} + if [[ ! -d $f ]]; then + echo "$f is not a directory!" + exit 1 + else + if [[ ! -f $f/requirements.txt ]]; then + echo "$f/requirements.txt is MISSING" + exit 1 + fi + pushd $f + + if !( grep -w "^reflex" requirements.txt >/dev/null 2>&1 ); then + echo "$f/requirements.txt does not contain 'reflex'" + exit 1 + fi + + python -m venv venv + source venv/bin/activate + + # pin reflex version - no moving target + pip install reflex==0.2.7 + pip install -r requirements.txt + reflex init + reflex export + for a in frontend.zip backend.zip; do + if unzip -t "$a"; then + echo "$a prepared as expected" + else + echo "ERROR: $a is not a valid zip file" + exit 1 + fi + done + + deactivate + popd + fi diff --git a/.github/workflows/check_requirements.yml b/.github/workflows/check_requirements.yml deleted file mode 100644 index 1f471301..00000000 --- a/.github/workflows/check_requirements.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: check-requirements -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - check-requirements: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: | - RC=0 - for f in $(ls -1); do - if [[ -d $f ]]; then - if [[ ! -f $f/requirements.txt ]]; then - echo "$f/requirements.txt is MISSING" - RC=1 - continue - fi - if !( grep -w "^reflex" $f/requirements.txt >/dev/null 2>&1 ); then - echo "$f/requirements.txt does not contain 'reflex'" - RC=1 - continue - fi - fi - done - exit $RC diff --git a/chatroom/.gitignore b/chatroom/.gitignore index 4865abd0..6cc169e1 100644 --- a/chatroom/.gitignore +++ b/chatroom/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/clock/.gitignore b/clock/.gitignore index bf56ff42..f6711845 100644 --- a/clock/.gitignore +++ b/clock/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/counter/.gitignore b/counter/.gitignore index bf56ff42..f6711845 100644 --- a/counter/.gitignore +++ b/counter/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/crm/.gitignore b/crm/.gitignore index bf56ff42..f6711845 100644 --- a/crm/.gitignore +++ b/crm/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/ecommerce/requirements.txt b/ecommerce/requirements.txt index 210218f4..685db61e 100644 --- a/ecommerce/requirements.txt +++ b/ecommerce/requirements.txt @@ -1 +1,3 @@ -reflex>=0.2.0 \ No newline at end of file +reflex>=0.2.0 +icecream==2.1.1 +pandas==2.1.0 \ No newline at end of file diff --git a/fragments/.gitignore b/fragments/.gitignore index bf56ff42..f6711845 100644 --- a/fragments/.gitignore +++ b/fragments/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/nba/.gitignore b/nba/.gitignore index bf56ff42..f6711845 100644 --- a/nba/.gitignore +++ b/nba/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/snakegame/.gitignore b/snakegame/.gitignore index bf56ff42..f6711845 100644 --- a/snakegame/.gitignore +++ b/snakegame/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/tailwind/.gitignore b/tailwind/.gitignore index bf56ff42..f6711845 100644 --- a/tailwind/.gitignore +++ b/tailwind/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/todo/.gitignore b/todo/.gitignore index bf56ff42..f6711845 100644 --- a/todo/.gitignore +++ b/todo/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/translator/.gitignore b/translator/.gitignore index bf56ff42..f6711845 100644 --- a/translator/.gitignore +++ b/translator/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/traversal/.gitignore b/traversal/.gitignore index bf56ff42..f6711845 100644 --- a/traversal/.gitignore +++ b/traversal/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/twitter/.gitignore b/twitter/.gitignore index bf56ff42..f6711845 100644 --- a/twitter/.gitignore +++ b/twitter/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/ diff --git a/upload/.gitignore b/upload/.gitignore index bf56ff42..f6711845 100644 --- a/upload/.gitignore +++ b/upload/.gitignore @@ -1,3 +1,4 @@ +*.db *.py[cod] .web __pycache__/