Merge pull request #52 from tchar/development #11
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: Linting | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- ".github/**" | |
- "!.github/workflows/ci-linux.yml" | |
- "docs/**" | |
- "misc/**" | |
- "__init__.py" | |
- ".gitignore" | |
- "LICENSE" | |
- "main.py" | |
- "manifest.json" | |
- "README.md" | |
- "versions.json" | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: [master] | |
paths-ignore: | |
- ".github/**" | |
- "!.github/workflows/ci-linux.yml" | |
- "docs/**" | |
- "misc/**" | |
- "__init__.py" | |
- ".gitignore" | |
- "LICENSE" | |
- "main.py" | |
- "manifest.json" | |
- "README.md" | |
- "versions.json" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
python-version: ["3.10"] | |
name: OS ${{ matrix.os }} - Python ${{ matrix.python-version }} | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
VERSION: v1 | |
steps: | |
- uses: actions/github-script@v4 | |
id: toxpy | |
with: | |
result-encoding: string | |
script: | | |
return process.env.PYTHON.split('.').join('') | |
- uses: actions/checkout@v2 | |
- name: Restore pip requirements | |
uses: actions/cache@v2 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ env.VERSION }}-${{ hashFiles('requirements/dev-requirements.txt') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ env.VERSION }}- | |
# - name: Restore tox requirements | |
# uses: actions/cache@v2 | |
# with: | |
# path: .tox | |
# key: ${{ matrix.os }}-${{ matrix.python-version }}-tox-${{ env.VERSION }}-${{ hashFiles('requirements/*requirements.txt') }} | |
# restore-keys: | | |
# ${{ matrix.os }}-${{ matrix.python-version }}-tox-${{ env.VERSION }}- | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/dev-requirements.txt | |
- name: Linting | |
run: | | |
tox -e linting | |
- name: Code style | |
run: | | |
tox -e codestyle |