Merge pull request #806 from weblate/weblate-fsfe-reuse-tool #494
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
# SPDX-FileCopyrightText: 2019 Free Software Foundation Europe e.V. <https://fsfe.org> | |
# SPDX-FileCopyrightText: 2022 Carmen Bianca Bakker <carmenbianca@fsfe.org> | |
# SPDX-FileCopyrightText: 2023 DB Systel GmbH | |
# | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
name: Test suites | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 10 | |
# do not abort the whole test job if one combination in the matrix fails | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
os: [ubuntu-20.04] | |
include: | |
- python-version: "3.8" | |
os: macos-latest | |
- python-version: "3.8" | |
os: 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: Install dependencies | |
run: | | |
pip install poetry | |
poetry install --no-interaction | |
- name: Run tests with pytest | |
run: | | |
# Re-enable this once | |
# https://github.com/pytest-dev/pytest-cov/issues/564 is resolved. | |
# poetry run pytest --cov=reuse | |
poetry run pytest | |
pylint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install --no-interaction | |
- name: Lint with Pylint | |
run: | | |
poetry run pylint src/reuse/ tests/ | |
black: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install --no-interaction | |
- name: Test formatting with black | |
run: | | |
poetry run isort --check src/ tests/ | |
poetry run black . | |
mypy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install --no-interaction | |
- name: Test typing with mypy | |
run: | | |
poetry run mypy | |
prettier: | |
runs-on: ubuntu-20.04 | |
container: node:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install prettier | |
run: npm install prettier@2.7.1 | |
- name: Run prettier | |
run: npx prettier --check . | |
reuse: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install --no-interaction --no-dev | |
- name: Test REUSE compliance | |
run: | | |
make reuse | |
docs: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
pip install -r docs/requirements.txt | |
- name: Create docs with Sphinx | |
run: | | |
make docs-ci |