Skip to content

Release v0.0.5

Release v0.0.5 #19

Workflow file for this run

name: Python CI
on:
push:
branches:
- main
paths-ignore:
- README.md
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: mybatis
MYSQL_DATABASE: mybatis
MYSQL_USER: mybatis
MYSQL_PASSWORD: mybatis
ports:
- 3306:3306
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install pytest pytest-cov mysql-connector-python Pympler
- name: Set up MySQL client
run: sudo apt-get install mysql-client
- name: Wait for MySQL to be ready
run: |
until mysql -h 127.0.0.1 -u mybatis -pmybatis -e "SELECT 1"; do
echo "Waiting for MySQL..."
sleep 2
done
echo "MySQL is ready!"
- name: Run tests with coverage
run: |
pytest --cov=mybatis --cov-report=xml test # 生成xml格式的报告
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml # 提交报告到 Codecov
token: ${{ secrets.CODECOV_TOKEN }}