You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yamllint/.github/workflows/ci.yaml

75 lines
2.0 KiB
YAML

---
name: CI
on: # yamllint disable-line rule:truthy
push:
pull_request:
branches:
- master
permissions:
contents: read
jobs:
lint:
name: Linters
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- run:
pip install flake8 flake8-import-order sphinx rstcheck[sphinx] doc8
- run: pip install .
- run: flake8 .
- run: doc8 $(git ls-files '*.rst')
- run: rstcheck --ignore-directives automodule $(git ls-files '*.rst')
- run: yamllint --strict $(git ls-files '*.yaml' '*.yml')
- run: make -C docs html
- name: Check for broken links in documentation
run: make -C docs linkcheck
test:
name: Tests
strategy:
fail-fast: false
matrix:
os: ['macos', 'ubuntu', 'windows']
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -e {0}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install .
- name: Append GitHub Actions system path
if: ${{ matrix.os == 'ubuntu' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: pip install coverage
if: ${{ matrix.os == 'ubuntu' }}
# https://github.com/AndreMiras/coveralls-python-action/issues/18
- run: echo -e "[run]\nrelative_files = True" > .coveragerc
if: ${{ matrix.os == 'ubuntu' }}
- run: coverage run -m unittest discover
if: ${{ matrix.os == 'ubuntu' }}
- name: Coveralls
if: ${{ matrix.os == 'ubuntu' }}
uses: AndreMiras/coveralls-python-action@develop
- name: Unittests only
if: ${{ matrix.os != 'ubuntu' }}
run: python -m unittest