Skip to content

CI: setup action can be stuck during by apt-get #654

@mmathieum

Description

@mmathieum

In shared-overwrite/.github/actions/setup/action.yml, MT code sync step can hang while using apt-get to install missing dependencies (like inkscape, libxml2-utils...).

Sometimes it's just very slow.

https://github.com/mtransitapps/ca-montreal-amt-train-android/actions/runs/24217828886/job/70702433276#step:3:1428

How can we prevent it? Can we use a max duration for the step and retry once automatically?

Is this a regular issue on GitHub-hosted runners?

https://github.com/mtransitapps/commons/blob/master/shared-overwrite/.github/actions/setup/action.yml

https://github.com/mtransitapps/commons/blob/master/commons.sh#L335

commons/commons.sh

Lines 335 to 339 in 94162c3

function requireCommand() {
local cmd=$1
local pkg=${2:-$cmd} # Default to cmd if pkg is not provided
command -v "$cmd" >/dev/null 2>&1 || (sudo apt-get update && sudo apt-get install -y "$pkg")
}

Maybe we could add a step before ./commons/code_sync.sh in the setup action responsible for pre-installing all missing dependencies because these packages will be needed for all repo soon anyway.

Current apt packages needed:

  • libxml2-utils
  • jq
  • inkscape
  • imagemagick

Metadata

Metadata

Labels

P3⏸️ Priority 3: Medium

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions