Adding a way to enable/disable lintian checks

This commit is contained in:
Jan Wagner 2022-10-28 11:22:24 +02:00 committed by Dawid Dziurla
parent b43ffb1f6d
commit 7bec10b9ba
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B
3 changed files with 25 additions and 15 deletions

View file

@ -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}}*.*

View file

@ -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

33
main.js
View file

@ -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", [