summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.github/cross/ubuntu-cross-armhf.txt18
-rw-r--r--.github/cross/ubuntu-cross-ppc64le.txt18
-rw-r--r--.github/cross/ubuntu-cross-s390x.txt18
-rw-r--r--.github/dependabot.yml7
-rw-r--r--.github/workflows/build.yml109
-rw-r--r--.github/workflows/checkpatch.yml15
-rw-r--r--.github/workflows/coverage.yml22
-rw-r--r--.github/workflows/release-python.yml73
-rw-r--r--.github/workflows/release.yml20
9 files changed, 300 insertions, 0 deletions
diff --git a/.github/cross/ubuntu-cross-armhf.txt b/.github/cross/ubuntu-cross-armhf.txt
new file mode 100644
index 0000000..41c8328
--- /dev/null
+++ b/.github/cross/ubuntu-cross-armhf.txt
@@ -0,0 +1,18 @@
+[binaries]
+c = '/usr/bin/arm-linux-gnueabihf-gcc'
+ar = '/usr/arm-linux-gnueabihf/bin/ar'
+strip = '/usr/arm-linux-gnueabihf/bin/strip'
+pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
+ld = '/usr/bin/arm-linux/gnueabihf-ld'
+exe_wrapper = '/usr/bin/qemu-arm-static'
+
+[properties]
+root = '/usr/arm-linux-gnueabihf'
+has_function_printf = true
+skip_sanity_check = true
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7'
+endian = 'little'
diff --git a/.github/cross/ubuntu-cross-ppc64le.txt b/.github/cross/ubuntu-cross-ppc64le.txt
new file mode 100644
index 0000000..6baaefb
--- /dev/null
+++ b/.github/cross/ubuntu-cross-ppc64le.txt
@@ -0,0 +1,18 @@
+[binaries]
+c = '/usr/bin/powerpc64le-linux-gnu-gcc'
+ar = '/usr/powerpc64le-linux-gnu/bin/ar'
+strip = '/usr/powerpc64le-linux-gnu/bin/strip'
+pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config'
+ld = '/usr/bin/powerpc64le-linux-gnu-ld'
+exe_wrapper = '/usr/bin/qemu-ppc64le-static'
+
+[properties]
+root = '/usr/powerpc64le-linux-gnu'
+has_function_printf = true
+skip_sanity_check = true
+
+[host_machine]
+system = 'linux'
+cpu_family = 'ppc64'
+cpu = ''
+endian = 'little'
diff --git a/.github/cross/ubuntu-cross-s390x.txt b/.github/cross/ubuntu-cross-s390x.txt
new file mode 100644
index 0000000..51a3511
--- /dev/null
+++ b/.github/cross/ubuntu-cross-s390x.txt
@@ -0,0 +1,18 @@
+[binaries]
+c = '/usr/bin/s390x-linux-gnu-gcc'
+ar = '/usr/s390x-linux-gnu/bin/ar'
+strip = '/usr/s390x-linux-gnu/bin/strip'
+pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'
+ld = '/usr/bin/s390x-linux-gnu-ld'
+exe_wrapper = '/usr/bin/qemu-s390x-static'
+
+[properties]
+root = '/usr/s390x-linux-gnu'
+has_function_printf = true
+skip_sanity_check = true
+
+[host_machine]
+system = 'linux'
+cpu_family = 's390x'
+cpu = ''
+endian = 'big'
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..23c4cb3
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,7 @@
+---
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..df79f65
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,109 @@
+---
+name: build
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+ branches: [master]
+
+ workflow_dispatch:
+
+jobs:
+ default:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ compiler: [gcc, clang]
+ buildtype: [debug, release]
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian.python:latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: build
+ run: |
+ scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }}
+ - uses: actions/upload-artifact@v4
+ name: upload logs
+ if: failure()
+ with:
+ name: logs files
+ path: |
+ .build-ci/meson-logs/*.txt
+
+ cross:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ include:
+ - arch: armhf
+ - arch: s390x
+ - arch: ppc64le
+ steps:
+ - uses: actions/checkout@v4
+ - name: enable foreign arch
+ uses: dbhi/qus/action@main
+ - name: compile and run unit tests
+ uses: mosteo-actions/docker-run@v1
+ with:
+ image: ghcr.io/igaw/linux-nvme/ubuntu-cross-${{ matrix.arch }}:latest
+ guest-dir: /build
+ host-dir: ${{ github.workspace }}
+ command: |
+ scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross
+ params: "--platform linux/amd64"
+ pull-params: "--platform linux/amd64"
+ - uses: actions/upload-artifact@v4
+ name: upload logs
+ if: failure()
+ with:
+ name: log files
+ path: |
+ .build-ci/meson-logs/*.txt
+
+ libdbus:
+ name: libdbus
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: build
+ run: |
+ scripts/build.sh -b release -c gcc libdbus
+ - uses: actions/upload-artifact@v4
+ name: upload logs
+ if: failure()
+ with:
+ name: log files
+ path: |
+ .build-ci/meson-logs/*.txt
+
+ fallback-shared-libraries:
+ name: fallback shared libraries
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:latest
+ if: github.ref == 'refs/heads/master'
+ steps:
+ - uses: actions/checkout@v4
+ - name: build
+ run: |
+ scripts/build.sh -b release -c gcc fallback
+ - uses: actions/upload-artifact@v4
+ if: failure()
+ with:
+ name: log files
+ path: |
+ .build-ci/meson-logs/*.txt
+
+ build-muon:
+ name: muon minimal static
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: build
+ run: |
+ scripts/build.sh -m muon
diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml
new file mode 100644
index 0000000..c0a09b7
--- /dev/null
+++ b/.github/workflows/checkpatch.yml
@@ -0,0 +1,15 @@
+name: checkpatch review
+on: [pull_request]
+jobs:
+ checkpatch:
+ name: checkpatch review
+ runs-on: ubuntu-latest
+ steps:
+ - name: 'Calculate PR commits + 1'
+ run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+ - name: Run checkpatch review
+ uses: webispy/checkpatch-action@v9
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
new file mode 100644
index 0000000..97ff3f4
--- /dev/null
+++ b/.github/workflows/coverage.yml
@@ -0,0 +1,22 @@
+---
+name: coverage
+
+on:
+ push:
+ branches: [master]
+
+jobs:
+ code-coverage:
+ if: github.repository == 'linux-nvme/libnvme'
+ name: code coverage
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian.python:latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: build
+ run: |
+ scripts/build.sh coverage
+ - uses: codecov/codecov-action@v4
+ with:
+ fail_ci_if_error: false
diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml
new file mode 100644
index 0000000..3ca68a9
--- /dev/null
+++ b/.github/workflows/release-python.yml
@@ -0,0 +1,73 @@
+---
+name: release python
+
+on:
+ push:
+ branches: [master]
+ tags:
+ - '**'
+ pull_request:
+ branches: [master]
+
+ workflow_dispatch:
+
+jobs:
+ build_sdist:
+ name: Build source distribution
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian.python:latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Allow workspace
+ run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
+
+ - name: Build sdist
+ run: pipx run build --sdist
+
+ - uses: actions/upload-artifact@v4
+ with:
+ path: dist/*.tar.gz
+ retention-days: 5
+
+ upload_test_pypi:
+ needs: [build_sdist]
+ runs-on: ubuntu-latest
+ if: startsWith(github.ref, 'refs/tags/v')
+ steps:
+ - uses: actions/download-artifact@v4
+ with:
+ name: artifact
+ path: dist
+
+ - name: Publish package to TestPyPI
+ uses: pypa/gh-action-pypi-publish@release/v1.5
+ with:
+ user: __token__
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
+ repository_url: https://test.pypi.org/legacy/
+
+ upload_pypi:
+ needs: [build_sdist]
+ runs-on: ubuntu-latest
+ if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'linux-nvme/libnvme'
+ steps:
+ - name: Check if it is a release tag
+ id: check-tag
+ run: |
+ if [[ ${{ github.event.ref }} =~ ^refs/tags/v([0-9]+\.[0-9]+)(\.[0-9]+)?(-rc[0-9]+)?$ ]]; then
+ echo ::set-output name=match::true
+ fi
+ - name: Download artifiact
+ uses: actions/download-artifact@v4
+ if: steps.check-tag.outputs.match == 'true'
+ with:
+ name: artifact
+ path: dist
+ - name: Publish package to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1.5
+ if: steps.check-tag.outputs.match == 'true'
+ with:
+ user: __token__
+ password: ${{ secrets.PYPI_API_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..d4ef038
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,20 @@
+---
+name: release
+
+on:
+ push:
+ branches: [master]
+ tags:
+ - '**'
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'linux-nvme/libnvme'
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ncipollo/release-action@v1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}