WIP: fix_build-dep #2

Draft
waja wants to merge 3 commits from fix_build-dep into master
2 changed files with 96 additions and 37 deletions

View file

@ -12,44 +12,44 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- package: at # - package: at
arch: arm # arch: arm
repo: https://salsa.debian.org/debian/at.git # repo: https://salsa.debian.org/debian/at.git
ref: debian/3.2.2-1 # ref: debian/3.2.2-1
lintian_opts: "-v" # lintian_opts: "-v"
lintian_run: false # lintian_run: false
- package: lolcat # - package: lolcat
arch: arm64 # arch: arm64
repo: https://salsa.debian.org/ruby-team/lolcat.git # repo: https://salsa.debian.org/ruby-team/lolcat.git
ref: debian/100.0.1-2 # ref: debian/100.0.1-2
lintian_opts: "-v" # lintian_opts: "-v"
- package: micro # - package: micro
arch: amd64 # arch: amd64
repo: https://salsa.debian.org/go-team/packages/micro.git # repo: https://salsa.debian.org/go-team/packages/micro.git
ref: debian/2.0.6-2_bpo10+1 # ref: debian/2.0.6-2_bpo10+1
lintian_opts: "-v" # lintian_opts: "-v"
lintian_run: true # lintian_run: true
- package: dropbear - package: dropbear
arch: amd64 arch: amd64
repo: https://salsa.debian.org/debian/dropbear.git repo: https://salsa.debian.org/debian/dropbear.git
ref: debian/2022.83-1_bpo11+1 ref: debian/2022.83-1_bpo11+1
lintian_opts: "-v" lintian_opts: "-v"
- package: deber # - package: deber
arch: arm64 # arch: arm64
repo: https://github.com/dawidd6/deber.git # repo: https://github.com/dawidd6/deber.git
ref: v1.0.0 # ref: v1.0.0
lintian_opts: "-v" # lintian_opts: "-v"
install_skopeo: true # install_skopeo: true
- package: netcat-openbsd # - package: netcat-openbsd
arch: arm64 # arch: arm64
repo: https://git.launchpad.net/ubuntu/+source/netcat-openbsd # repo: https://git.launchpad.net/ubuntu/+source/netcat-openbsd
ref: import/1.206-1ubuntu1 # ref: import/1.206-1ubuntu1
lintian_opts: "-v" # lintian_opts: "-v"
- package: iproute2 # - package: iproute2
arch: arm # arch: arm
repo: https://git.launchpad.net/ubuntu/+source/iproute2 # repo: https://git.launchpad.net/ubuntu/+source/iproute2
ref: import/4.18.0-1ubuntu2_ubuntu18.04.1 # ref: import/4.18.0-1ubuntu2_ubuntu18.04.1
lintian_opts: "-v" # lintian_opts: "-v"
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4

67
main.js
View file

@ -68,8 +68,8 @@ async function main() {
const match = changelog.match(regex) const match = changelog.match(regex)
const { pkg, epoch, version, revision, packageDistribution } = match.groups const { pkg, epoch, version, revision, packageDistribution } = match.groups
const distribution = osDistribution ? osDistribution : packageDistribution const distribution = osDistribution ? osDistribution : packageDistribution
const imageName = await getImageName(distribution) const imageName = "ubuntu"
const imageTag = await getImageTag(imageName, distribution) const imageTag = "jammy"
const container = pkg const container = pkg
const image = imageName + ":" + imageTag const image = imageName + ":" + imageTag
@ -95,6 +95,20 @@ async function main() {
console.log(details) console.log(details)
core.endGroup() core.endGroup()
core.startGroup("Check sourceDirectory")
await exec.exec("ls", ["-la", sourceDirectory])
core.endGroup()
core.startGroup("Create test files")
await exec.exec("mkdir", ["-p", workspaceDirectory + "/foo"])
await exec.exec("touch", [ workspaceDirectory + "/foo/bar.txt"])
core.endGroup()
core.startGroup("Check test files")
await exec.exec("ls", ["-la", workspaceDirectory])
await exec.exec("ls", ["-la", workspaceDirectory + "/foo"])
core.endGroup()
if (cpuArchitecture != "amd64") { if (cpuArchitecture != "amd64") {
core.startGroup("Install QEMU") core.startGroup("Install QEMU")
// Need newer QEMU to avoid errors // Need newer QEMU to avoid errors
@ -109,7 +123,7 @@ async function main() {
"--platform", `linux/${cpuArchitecture}`, "--platform", `linux/${cpuArchitecture}`,
"--name", container, "--name", container,
"--volume", workspaceDirectory + ":" + workspaceDirectory, "--volume", workspaceDirectory + ":" + workspaceDirectory,
"--workdir", sourceDirectory, "--workdir", workspaceDirectory,
"--env", "DEBIAN_FRONTEND=noninteractive", "--env", "DEBIAN_FRONTEND=noninteractive",
"--env", "DPKG_COLORS=always", "--env", "DPKG_COLORS=always",
"--env", "FORCE_UNSAFE_CONFIGURE=1", "--env", "FORCE_UNSAFE_CONFIGURE=1",
@ -127,6 +141,49 @@ async function main() {
]) ])
core.endGroup() core.endGroup()
core.startGroup("Check workspaceDirectory")
await exec.exec("docker", [
"exec",
container,
"ls", "-la", workspaceDirectory
])
core.endGroup()
core.startGroup("Sleeping well ...")
await exec.exec("sleep", [
"10000"
])
core.endGroup()
core.startGroup("Check test files")
await exec.exec("docker", [
"exec",
container,
"ls", "-la", workspaceDirectory + "/foo"
])
core.endGroup()
core.startGroup("Check sourceDirectory")
await exec.exec("docker", [
"exec",
container,
"ls", "-la", sourceDirectory
])
core.endGroup()
core.startGroup("Show container inspect")
await exec.exec("docker", [
"inspect",
container
])
core.endGroup()
core.startGroup("Sleeping well ...")
await exec.exec("sleep", [
"10000"
])
core.endGroup()
/*
core.startGroup("Prepare environment") core.startGroup("Prepare environment")
await exec.exec("docker", [ await exec.exec("docker", [
"exec", "exec",
@ -189,7 +246,8 @@ async function main() {
"exec", "exec",
container, container,
"bash", "-c", "bash", "-c",
`apt-get build-dep -yq -t '${imageTag}' '${sourceDirectory}' || apt-get build-dep -yq '${sourceDirectory}'` // `apt-get build-dep -yq -t '${imageTag}' '${sourceDirectory}' || apt-get build-dep -yq '${sourceDirectory}'`
`cd '${sourceDirectory}' && apt-get build-dep -yq -t '${imageTag}' . || apt-get build-dep -yq .`
]) ])
core.endGroup() core.endGroup()
} }
@ -264,6 +322,7 @@ async function main() {
"-exec", "mv", "{}", artifactsDirectory, ";" "-exec", "mv", "{}", artifactsDirectory, ";"
]) ])
core.endGroup() core.endGroup()
*/
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }