Update README.md #13
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: Python Package | |
on: | |
push: | |
branches: [ main, master, development ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
# Add Redis service | |
services: | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
working-directory: ./kew | |
run: | | |
python -m pip install --upgrade pip | |
# Install test dependencies | |
pip install build pytest pytest-cov pytest-asyncio pytest-redis | |
pip install redis aioredis | |
pip install -e ".[test]" | |
- name: Run tests with coverage | |
working-directory: ./kew | |
env: | |
REDIS_URL: redis://localhost:6379 | |
run: | | |
pytest --cov=kew --cov-report=term-missing | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build twine | |
- name: Build package | |
working-directory: ./kew | |
run: python -m build | |
- name: Check package | |
working-directory: ./kew | |
run: twine check dist/* | |
- name: Store build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: kew/dist/ |