| name: Continuous Integration | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| pull_request: | |
| branches: [ "main" ] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.8", "3.9", "3.10"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 pytest tox tox-gh-actions | |
| pip install -r requirements.txt | |
| - name: Test with tox | |
| run: tox | |