Skip to content

Tennis app

Tennis app #10

Workflow file for this run

name: Run Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
tests:
runs-on:
- ubuntu-latest
services:
mysql:
image: mysql:latest
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: test_db
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.11'
cache: 'true'
- name: Install dependencies
run: pdm install
- name: Set environment variables
run: echo "DJANGO_ENV=test" >> $GITHUB_ENV
# - name: Create MySQL user with native password
# run: |
# sudo apt-get install -y mysql-client
# mysql -h localhost -u root -ptest_password -e "CREATE USER 'test_user'@'%' IDENTIFIED WITH mysql_native_password BY 'test_password';"
# mysql -h localhost -u root -ptest_password -e "GRANT ALL PRIVILEGES ON test_db.* TO 'test_user'@'%';"
# mysql -h localhost -u root -ptest_password -e "FLUSH PRIVILEGES;"
- name: Run code formatting check
run: pdm run check_code_format
# - name: Run CalculatorApp test
# run: pdm run test_calculator
# - name: Run Main App tests
# run: pdm run tests
# - name: Run coverage report
# run: pdm run coverage_report