Merge pull request #187 from andrlik/master #67
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: CI | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Configure pip caching | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt')}}-${{ hashFiles('**/requirements-dev.txt') }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: Validate against psf/black | |
run: python -m black --check markovify test | |
- name: Validate against flake8 | |
run: python -m flake8 markovify test | |
tests: | |
needs: lint | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Configure pip caching | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt')}}-${{ hashFiles('**/requirements-dev.txt') }} | |
- name: Install Python dependencies | |
run: | | |
python -m site | |
python -m pip install --upgrade pip setuptools wheel | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: Run tests | |
run: make tests | |
- name: Upload code coverage | |
uses: codecov/[email protected] | |
if: matrix.python-version == 3.9 | |
- name: Build package | |
run: python setup.py build sdist |