Implement lintian support

This commit is contained in:
Jan Wagner 2022-10-27 13:00:43 +02:00 committed by Dawid Dziurla
parent 2d5606cf18
commit b43ffb1f6d
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B
3 changed files with 31 additions and 2 deletions

View file

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

View file

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

21
main.js
View file

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