Skip to content

Commit

Permalink
matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
jackie-pc committed Sep 11, 2023
1 parent c58bad0 commit 2c3f086
Showing 1 changed file with 45 additions and 31 deletions.
76 changes: 45 additions & 31 deletions .github/workflows/check_export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,58 @@ on:
branches: [ main ]

jobs:
list-examples:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.generate-matrix.outputs.examples }}
steps:
- name: Generate Matrix
id: generate-matrix
run: |
# TODO fix sales export
EXAMPLES="[$(ls -1 | grep -v sales)]"
echo ::set-output name=examples::${EXAMPLES}
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: |
# TODO fix sales export
for f in $(ls -1 | grep -vw sales); do
if [[ -d $f ]]; then
if [[ ! -f $f/requirements.txt ]]; then
echo "$f/requirements.txt is MISSING"
exit 1
fi
pushd $f
f=${{ matrix.example }}
if [[ -d $f ]]; then
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
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
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
# 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
done
deactivate
popd
fi

0 comments on commit 2c3f086

Please sign in to comment.