Merge pull request #478 from martin-belanger/add-more-coverage #30
This file contains hidden or 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: Linters | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| docker-lint: | |
| if: ${{ !github.event.act }} # skip during local actions testing | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: hadolint/hadolint-action@v3.3.0 | |
| with: | |
| recursive: true | |
| ignore: DL3041 | |
| python-lint-Jammy: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10"] | |
| steps: | |
| - name: "CHECKOUT: nvme-stas" | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: "INSTALL: apt-get packages" | |
| run: | | |
| sudo apt update | |
| sudo apt-get install --yes --quiet ninja-build cmake libgirepository1.0-dev libsystemd-dev swig libjson-c-dev | |
| sudo apt-get install --yes --quiet python3-wheel python3-systemd python3-pyudev python3-dasbus python3-gi python3-lxml python3-tomli | |
| - name: "INSTALL: pip packages" | |
| run: | | |
| pip install meson==0.62.0 ruff | |
| - name: "BUILD: [libnvme, nvme-stas]" | |
| run: | | |
| meson setup .build --buildtype=release --sysconfdir=/etc --prefix=/usr -Dnvme-cli:buildtype=release -Dnvme-cli:sysconfdir=/etc -Dnvme-cli:prefix=/usr -Dnvme-cli:python=enabled -Dnvme-cli:libdbus=disabled -Dnvme-cli:openssl=disabled -Dnvme-cli:json-c=disabled -Dnvme-cli:keyutils=disabled | |
| meson compile -C .build | |
| - name: Set PYTHONPATH | |
| run: | | |
| echo "PYTHONPATH=.build:.build/subprojects/nvme-cli/libnvme:/usr/lib/python3/dist-packages" >> $GITHUB_ENV | |
| - name: Show test environment | |
| run: | | |
| echo -e "Build Directory:\n$(ls -laF .build)" | |
| python3 -VV | |
| python3 -m site | |
| ruff --version | |
| - name: "Ruff: lint" | |
| run: | | |
| ruff check --diff .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib | |
| - name: "Ruff: format" | |
| if: always() | |
| run: | | |
| ruff format --check --diff .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib | |
| python-lint-Noble: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - name: "CHECKOUT: nvme-stas" | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: "INSTALL: apt-get packages" | |
| run: | | |
| sudo apt update | |
| sudo apt-get install --yes --quiet meson ninja-build cmake libgirepository1.0-dev libsystemd-dev swig libjson-c-dev | |
| sudo apt-get install --yes --quiet python3-wheel python3-systemd python3-pyudev python3-dasbus python3-gi python3-lxml python3-tomli | |
| - name: "INSTALL: pip packages" | |
| run: | | |
| pip install ruff | |
| - name: "BUILD: [libnvme, nvme-stas]" | |
| run: | | |
| meson setup .build --buildtype=release --sysconfdir=/etc --prefix=/usr -Dnvme-cli:buildtype=release -Dnvme-cli:sysconfdir=/etc -Dnvme-cli:prefix=/usr -Dnvme-cli:python=enabled -Dnvme-cli:libdbus=disabled -Dnvme-cli:openssl=disabled -Dnvme-cli:json-c=disabled -Dnvme-cli:keyutils=disabled | |
| meson compile -C .build | |
| - name: Set PYTHONPATH | |
| run: | | |
| echo "PYTHONPATH=.build:.build/subprojects/nvme-cli/libnvme:/usr/lib/python3/dist-packages" >> $GITHUB_ENV | |
| - name: Show test environment | |
| run: | | |
| echo -e "Build Directory:\n$(ls -laF .build)" | |
| python3 -VV | |
| python3 -m site | |
| ruff --version | |
| - name: "Ruff: lint" | |
| run: | | |
| ruff check --diff .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib | |
| - name: "Ruff: format" | |
| if: always() | |
| run: | | |
| ruff format --check --diff .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib |