diff options
Diffstat (limited to '.github/workflows/meson-test.yml')
-rw-r--r-- | .github/workflows/meson-test.yml | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/.github/workflows/meson-test.yml b/.github/workflows/meson-test.yml new file mode 100644 index 0000000..2909ffa --- /dev/null +++ b/.github/workflows/meson-test.yml @@ -0,0 +1,76 @@ +name: Meson + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + workflow_dispatch: + +jobs: + meson-build: + runs-on: ubuntu-latest + steps: + - name: "CHECKOUT: nvme-stas" + uses: actions/checkout@v3 + + - name: "INSTALL: Overall dependencies" + run: | + sudo apt-mark hold grub-efi-amd64-signed # Workaround for upstream issue + sudo apt-get update --yes --quiet + sudo apt-get upgrade --yes --quiet + sudo apt-get install --yes --quiet python3-pip cmake iproute2 + sudo python3 -m pip install --upgrade pip + sudo python3 -m pip install --upgrade wheel meson ninja + + - name: "INSTALL: nvme-stas dependencies" + run: | + sudo apt-get install --yes --quiet docbook-xml + sudo apt-get install --yes --quiet docbook-xsl + sudo apt-get install --yes --quiet xsltproc + sudo apt-get install --yes --quiet libglib2.0-dev + sudo apt-get install --yes --quiet libgirepository1.0-dev + sudo apt-get install --yes --quiet libsystemd-dev + sudo apt-get install --yes --quiet python3-systemd + sudo apt-get install --yes --quiet python3-pyudev + sudo apt-get install --yes --quiet python3-lxml + python3 -m pip install --upgrade dasbus pylint pyflakes PyGObject + python3 -m pip install --upgrade vermin pyfakefs importlib-resources + + - name: "INSTALL: libnvme" + run: | + sudo apt-get install --yes --quiet swig libjson-c-dev + meson subprojects download + meson setup .build subprojects/libnvme -Dlibdbus=disabled -Dopenssl=disabled -Dbuildtype=release -Dprefix=/usr -Dpython=true + ninja -C .build + sudo meson install -C .build + + - name: "CONFIG: PYTHONPATH" + run: | + echo "PYTHONPATH=.build:.build/subprojects/libnvme:/usr/lib/python3/dist-packages/" >> $GITHUB_ENV + + - name: "TEST: nvme-stas" + uses: BSFishy/meson-build@v1.0.3 + with: + action: test + directory: .build + setup-options: -Dman=true -Dhtml=true + options: --print-errorlogs --suite nvme-stas + + # Preserve meson's log file on failure + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: "Linux_Meson_Testlog" + path: .build/meson-logs/* + + - name: "Generate coverage report" + run: | + python3 -m pip install pytest + python3 -m pip install pytest-cov + PYTHONPATH=.build:.build/subprojects/libnvme:/usr/lib/python3/dist-packages/ pytest --cov=./staslib --cov-report=xml test/test-*.py + + - uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: false
\ No newline at end of file |