From 068a45420f2c98887e220b45e946cc7074da550e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 21:22:29 +0200 Subject: Adding upstream version 1.8. Signed-off-by: Daniel Baumann --- .github/workflows/build.yml | 109 +++++++++++++++++++++++++++++++++++ .github/workflows/checkpatch.yml | 15 +++++ .github/workflows/coverage.yml | 22 +++++++ .github/workflows/release-python.yml | 73 +++++++++++++++++++++++ .github/workflows/release.yml | 20 +++++++ 5 files changed, 239 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/checkpatch.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/release-python.yml create mode 100644 .github/workflows/release.yml (limited to '.github/workflows') 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 }} -- cgit v1.2.3