Skip to content

Adjust CI scripts so they can be run with 'pmbootstrap ci'

Oliver Smith requested to merge pmbootstrap-ci-support into master

In pmbootstrap master, there is a new action called pmbootstrap ci. It allows running CI scripts of the git repository that the user is currently working in (working directory), if they have a certain format. It already works with pmbootstrap.git. These patches adjust the scripts in pmaports.git so they fit that format.

More information: https://postmarketos.org/pmb-ci

todo

  • add distfile-check too, so we really have all of them
    • currently this downloads a script from here
    • maybe download it only once and cache it, or rewrite it as python test and put it into this repo
    • EDIT 2022-11-04: rewrote it as python test, see commit messages. The nice thing is that I extended the sha512sums= parsing function for this and will be able to use this for an extended pkgver/pkgrel test in a follow-up MR.
  • make sure all CI scripts still work in gitlab CI by making test changes to relevant files (some checks only run when specific files are modified)
    • Done! Created a test MR in my own gitlab namespace (ollieparanoid/pmaports!1) that has all commits from here plus one test commit that changes a device package and a kernel config, everything passes.
  • FIXME: the build tests are failing with the following error when running through pmbootstrap ci
    • this was a local error on my end in one VM - not sure what caused it but couldn't reproduce it elsewhere and should not block this MR.

-> Ready to go! Please review.

>>> hello-world: Installing for build: build-base
Waiting for repository lock
ERROR: Unable to lock database: Bad file descriptor
ERROR: Failed to open apk database: Bad file descriptor

demo output

$ pmbootstrap ci
[17:37:11] WARNING: this git repository has uncommitted changes
[17:37:11] Available CI scripts (15):
[17:37:11] * flake8: lint CI related python scripts/tests
[17:37:11] * apkbuild-lint: run apkbuild-lint on modified APKBUILDs
[17:37:11] * wiki: verify devices are documented in the wiki
[17:37:11] * ec: editorconfig-checker: lint for trailing whitespaces etc.
[17:37:11] * pytest: lint with various python tests
[17:37:11] * commits: check pkgver/pkgrel bumps, amount of changed pkgs etc
[17:37:11] * kconfig: check all kernel configs with 'pmbootstrap kconfig check'
[17:37:11] * grep: check various bad patterns with grep
[17:37:11] * shellcheck: lint all shell scripts
[17:37:11] * build-riscv64: build modified packages for this architecture (slow)
[17:37:11] * build-x86: build modified packages for this architecture (slow)
[17:37:11] * build-armhf: build modified packages for this architecture (slow)
[17:37:11] * build-aarch64: build modified packages for this architecture (slow)
[17:37:11] * build-x86_64: build modified packages for this architecture (slow)
[17:37:11] * build-armv7: build modified packages for this architecture (slow)
[17:37:11] Which script? [all]:

Also it's possible to specify scripts on the command-line:

$ pmbootstrap ci wiki ec pytest
Edited by Oliver Smith

Merge request reports