From b43ffb1f6d61bc9173ecdea14c99ab108d9624f5 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Thu, 27 Oct 2022 13:00:43 +0200 Subject: [PATCH] Implement lintian support --- .github/workflows/test.yml | 8 ++++++++ action.yml | 4 ++++ main.js | 21 +++++++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd71c6f..a3d6dae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,30 +16,37 @@ jobs: arch: arm repo: https://salsa.debian.org/debian/at.git ref: debian/3.1.23-1 + lintian_opts: "-v" - package: lolcat arch: arm64 repo: https://salsa.debian.org/ruby-team/lolcat.git ref: debian/100.0.1-2 + lintian_opts: "-v" - package: micro arch: amd64 repo: https://salsa.debian.org/go-team/packages/micro.git ref: debian/2.0.6-2_bpo10+1 + lintian_opts: "-v" - package: dropbear arch: amd64 repo: https://salsa.debian.org/debian/dropbear.git ref: debian/2016.74-5+deb9u1 + lintian_opts: "-v" - package: deber arch: arm64 repo: https://github.com/dawidd6/deber.git ref: v1.0.0 + lintian_opts: "-v" - package: netcat-openbsd arch: arm64 repo: https://git.launchpad.net/ubuntu/+source/netcat-openbsd ref: import/1.206-1ubuntu1 + lintian_opts: "-v" - package: iproute2 arch: arm repo: https://git.launchpad.net/ubuntu/+source/iproute2 ref: import/4.18.0-1ubuntu2_ubuntu18.04.1 + lintian_opts: "-v" steps: - name: Checkout code uses: actions/checkout@v2 @@ -51,6 +58,7 @@ jobs: cpu_architecture: ${{matrix.arch}} source_directory: ${{matrix.package}} artifacts_directory: artifacts + lintian_opts: ${{matrix.lintian_opts}} - name: Check files run: | ls -lh artifacts/${{matrix.package}}*.* diff --git a/action.yml b/action.yml index c9771ce..542f71e 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,10 @@ inputs: os_distribution: description: OS distribution name, value from `debian/changelog` is used if not defined required: false + lintian_opts: + description: Command line parameters provided to 'lintian' + required: false + default: "" runs: using: node16 main: main.js diff --git a/main.js b/main.js index 8198b4d..e333c10 100644 --- a/main.js +++ b/main.js @@ -38,6 +38,7 @@ async function main() { const sourceRelativeDirectory = core.getInput("source_directory") || "./" const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./" const osDistribution = core.getInput("os_distribution") || "" + const lintianOpts = core.getInput("lintian_opts") || "" const workspaceDirectory = process.cwd() const sourceDirectory = path.join(workspaceDirectory, sourceRelativeDirectory) @@ -70,7 +71,8 @@ async function main() { workspaceDirectory: workspaceDirectory, sourceDirectory: sourceDirectory, buildDirectory: buildDirectory, - artifactsDirectory: artifactsDirectory + artifactsDirectory: artifactsDirectory, + lintianOpts: lintianOpts } console.log(details) core.endGroup() @@ -151,7 +153,7 @@ async function main() { "exec", container, "bash", "-c", - `apt-get install -yq -t '${imageTag}' dpkg-dev debhelper devscripts || apt-get install -yq dpkg-dev debhelper devscripts` + `apt-get install -yq -t '${imageTag}' dpkg-dev debhelper devscripts lintian || apt-get install -yq dpkg-dev debhelper devscripts lintian` ]) core.endGroup() @@ -185,6 +187,21 @@ async function main() { ]) core.endGroup() + core.startGroup("Run static analysis") + await exec.exec("docker", [ + "exec", + container, + "find", + buildDirectory, + "-maxdepth", "1", + "-name", `*${version}*.changes`, + "-type", "f", + "-print", + "-exec", "lintian", lintianOpts, "{}", "\+" + + ]) + core.endGroup() + core.startGroup("Install built packages") await exec.exec("docker", [ "exec",