From 7bec10b9ba52aa5398741f2df2cceb456e9eae79 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 28 Oct 2022 11:22:24 +0200 Subject: [PATCH] Adding a way to enable/disable lintian checks --- .github/workflows/test.yml | 3 +++ action.yml | 4 ++++ main.js | 33 ++++++++++++++++++--------------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3d6dae..0245677 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,7 @@ jobs: repo: https://salsa.debian.org/debian/at.git ref: debian/3.1.23-1 lintian_opts: "-v" + lintian_run: false - package: lolcat arch: arm64 repo: https://salsa.debian.org/ruby-team/lolcat.git @@ -27,6 +28,7 @@ jobs: repo: https://salsa.debian.org/go-team/packages/micro.git ref: debian/2.0.6-2_bpo10+1 lintian_opts: "-v" + lintian_run: true - package: dropbear arch: amd64 repo: https://salsa.debian.org/debian/dropbear.git @@ -59,6 +61,7 @@ jobs: source_directory: ${{matrix.package}} artifacts_directory: artifacts lintian_opts: ${{matrix.lintian_opts}} + lintian_run: ${{matrix.lintian_run || false }} - name: Check files run: | ls -lh artifacts/${{matrix.package}}*.* diff --git a/action.yml b/action.yml index 542f71e..f451bb5 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: description: Command line parameters provided to 'lintian' required: false default: "" + lintian_run: + description: Run lintian checks + required: false + default: false runs: using: node16 main: main.js diff --git a/main.js b/main.js index e333c10..6842f7a 100644 --- a/main.js +++ b/main.js @@ -39,6 +39,7 @@ async function main() { const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./" const osDistribution = core.getInput("os_distribution") || "" const lintianOpts = core.getInput("lintian_opts") || "" + const lintianRun = core.getBooleanInput('lintian_run') || false const workspaceDirectory = process.cwd() const sourceDirectory = path.join(workspaceDirectory, sourceRelativeDirectory) @@ -72,7 +73,8 @@ async function main() { sourceDirectory: sourceDirectory, buildDirectory: buildDirectory, artifactsDirectory: artifactsDirectory, - lintianOpts: lintianOpts + lintianOpts: lintianOpts, + lintianRun: lintianRun } console.log(details) core.endGroup() @@ -187,20 +189,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() + if (lintianRun){ + 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", [