Implement Python sample app #27
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
name: Run Tests | |
on: | |
pull_request: | |
jobs: | |
validate: | |
strategy: | |
matrix: | |
# Run in all these versions of Python | |
# current and last three python versions | |
python-version: | |
- "3.12" | |
- "3.11" | |
- "3.10" | |
- "3.9" | |
runs-on: ubuntu-latest | |
services: | |
fauna: | |
image: fauna/faunadb | |
ports: | |
- 8443:8443 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # caching pip dependencies | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
- name: Run unit tests | |
run: python3 -m unittest discover | |
- name: Install fauna-shell | |
run: | |
npm install -g fauna-shell | |
- name: Setup Test Database | |
run: ./scripts/setup.sh | |
- name: Test sample app | |
run: | | |
cd ecommerce_app | |
FAUNA_ENDPOINT=http://localhost:8443 FAUNA_SECRET=`cat ../.fauna_key` python3 -m flask run > ../app.log 2>&1 & | |
cd .. | |
./scripts/validate.sh | |
cat app.log |