From fc67d3ad9a2903cc33e5cdaedaad51dd86a42236 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 24 Dec 2023 08:57:49 +0100 Subject: Adding upstream version 2.7.1. Signed-off-by: Daniel Baumann --- .github/AppImageBuilder.yml | 1 - .github/codeql/codeql-config.yml | 3 ++ .github/workflows/appimage.yml | 44 ++++++++++--------------- .github/workflows/build.yml | 71 ++++++++++++++++++---------------------- .github/workflows/checkpatch.yml | 15 +++++++++ .github/workflows/codeql.yml | 71 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/coverage.yml | 22 +++++++++++++ .github/workflows/release.yml | 4 +-- 8 files changed, 162 insertions(+), 69 deletions(-) create mode 100644 .github/codeql/codeql-config.yml create mode 100644 .github/workflows/checkpatch.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/coverage.yml (limited to '.github') diff --git a/.github/AppImageBuilder.yml b/.github/AppImageBuilder.yml index 67b215c..cce4689 100644 --- a/.github/AppImageBuilder.yml +++ b/.github/AppImageBuilder.yml @@ -27,7 +27,6 @@ AppDir: - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse include: - libjson-c5 - - libhugetlbfs0 - libssl3 files: include: diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..d9079fd --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,3 @@ +name: "CodeQL Config" +paths-ignore: + - subprojects/** diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index f7b7ae0..6c0d3e5 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -13,41 +13,31 @@ jobs: build-appimage: name: build AppImage runs-on: ubuntu-latest + container: + image: ghcr.io/igaw/linux-nvme/debian:latest steps: - - uses: actions/checkout@v3 - - name: install dependencies - run: sudo apt-get install libjson-c-dev libssl-dev libdbus-1-dev libhugetlbfs-dev - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - uses: BSFishy/meson-build@v1.0.3 - with: - setup-options: > - --werror - --buildtype=release - --prefix=/usr - --force-fallback-for=libnvme - -Dlibnvme:werror=false - action: install - meson-version: 0.61.2 - - name: build AppImage - uses: AppImageCrafters/build-appimage@v1.3 - with: - recipe: .github/AppImageBuilder.yml - - uses: actions/upload-artifact@v3 - name: upload artifacts to github - with: - name: AppImage - path: '*.AppImage*' + - uses: actions/checkout@v4 + - name: build + run: | + scripts/build.sh appimage + - name: build AppImage + uses: AppImageCrafters/build-appimage@v1.3 + with: + recipe: .github/AppImageBuilder.yml + - uses: actions/upload-artifact@v4 + name: upload artifacts to github + with: + name: AppImage + path: '*.AppImage*' deploy-appimage: name: deploy AppImage runs-on: ubuntu-latest needs: build-appimage - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'linux-nvme/nvme-cli' }} steps: - name: Download artifact - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: workflow: ${{ github.event.workflow_run.workflow_id }} workflow_conclusion: success diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3e2fd4..0b12517 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,16 +17,13 @@ jobs: compiler: [gcc, clang] buildtype: [debug, release] container: - image: ghcr.io/igaw/linux-nvme/debian:0.30 + image: ghcr.io/igaw/linux-nvme/debian.python:latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.x' + - uses: actions/checkout@v4 - name: build run: | scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: upload logs if: failure() with: @@ -40,34 +37,23 @@ jobs: matrix: include: - arch: armhf - port: armhf - compiler: gcc-arm-linux-gnueabihf - packages: - arch: s390x - port: s390x - compiler: gcc-s390x-linux-gnu - packages: libgcc-s1:s390x - arch: ppc64le - port: ppc64el - compiler: gcc-powerpc64le-linux-gnu - packges: steps: - - uses: actions/checkout@v3 - - name: set up arm architecture - run: | - export release=$(lsb_release -c -s) - sudo dpkg --add-architecture ${{ matrix.port }} - sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list - sudo dd of=/etc/apt/sources.list.d/${{ matrix.arch }}.list <> $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/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..d57e17a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,71 @@ +# CodeQL build configuration for nvme-cli +# Mostly based on auto-configuration with additions and tweaks for: +# * meson install +# * language detection +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '24 2 * * 5' + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: 'ubuntu-latest' + timeout-minutes: 360 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'c-cpp', 'python' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install meson + + # Initializes the CodeQL tools for scanning. + - if: matrix.language == 'c-cpp' + name: Initialize CodeQL C + uses: github/codeql-action/init@v3 + with: + languages: 'c-cpp' + + - if: matrix.language == 'python' + name: Initialize CodeQL Python + uses: github/codeql-action/init@v3 + with: + languages: 'python' + config-file: ./.github/codeql/codeql-config.yml + + - name: meson build + run: | + meson setup --force-fallback-for=libnvme,json-c .build + ninja -C .build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..d272d0f --- /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/nvme-cli' + 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@v3 + with: + fail_ci_if_error: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c88be9e..8a5651c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,11 @@ on: jobs: build: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'linux-nvme/nvme-cli' permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3