Skip to content

wip github actions

wip github actions #16

Workflow file for this run

name: Python Test with MySQL
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_DATABASE: testgrocer
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11.2'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run Python script
id: test_result
run: |
cd src
python test_main.py || echo "Test failed"
- name: Determine test result
run: |
if [[ "${{ steps.test_result.outputs.stdout }}" == *"OK"* ]]; then
echo "Test passed"
else
echo "Test failed"
exit 1
fi