|
| 1 | +# SPDX-FileCopyrightText: 2024 DB Systel GmbH |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +name: Test suites |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + pull_request: |
| 12 | + |
| 13 | +jobs: |
| 14 | + # Test using the tool via poetry on different OSes and python versions |
| 15 | + test-os-python-matrix: |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + max-parallel: 10 |
| 19 | + # do not abort the whole test job if one combination in the matrix fails |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + python-version: ["3.10", "3.11", "3.12"] |
| 23 | + os: [ubuntu-22.04] |
| 24 | + include: |
| 25 | + - python-version: "3.10" |
| 26 | + os: macos-latest |
| 27 | + - python-version: "3.10" |
| 28 | + os: windows-latest |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + - uses: ./.github/actions/poetrybuild |
| 33 | + with: |
| 34 | + python: ${{ matrix.python-version }} |
| 35 | + poetry_args: --only main |
| 36 | + - name: Execute gh-org-mgr |
| 37 | + run: poetry run gh-org-mgr --help |
| 38 | + |
| 39 | + # Test building the package and installing it via pip3 |
| 40 | + test-build-install: |
| 41 | + runs-on: ubuntu-22.04 |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + - name: Set up Python |
| 45 | + uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: "3.10" |
| 48 | + - name: Install poetry |
| 49 | + run: pip install poetry |
| 50 | + - name: Build package |
| 51 | + run: poetry build |
| 52 | + - name: Install package |
| 53 | + run: pip3 install dist/github_org_manager-*.tar.gz |
| 54 | + - name: Run package |
| 55 | + run: | |
| 56 | + gh-org-mgr --version |
| 57 | + gh-org-mgr --help |
| 58 | +
|
| 59 | + # Formatting |
| 60 | + pylint: |
| 61 | + runs-on: ubuntu-22.04 |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v4 |
| 64 | + - uses: ./.github/actions/poetrybuild |
| 65 | + - name: Lint with pylint |
| 66 | + run: poetry run pylint gh_org_mgr/ |
| 67 | + |
| 68 | + formatting: |
| 69 | + runs-on: ubuntu-22.04 |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + - uses: ./.github/actions/poetrybuild |
| 73 | + - name: Test formatting with isort and black |
| 74 | + run: | |
| 75 | + poetry run isort --check gh_org_mgr/ |
| 76 | + poetry run black --check . |
| 77 | +
|
| 78 | + mypy: |
| 79 | + runs-on: ubuntu-22.04 |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v4 |
| 82 | + - uses: ./.github/actions/poetrybuild |
| 83 | + - name: Test typing with mypy |
| 84 | + run: poetry run mypy |
| 85 | + |
| 86 | + # REUSE |
| 87 | + reuse: |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + - name: Check REUSE Compliance |
| 92 | + uses: fsfe/reuse-action@v3 |
0 commit comments