ci: standardize apt-get update/install

General changes:

* Use a single -q on update, as the output is not too long
* Use a single -q on install, to show all packages at once

GitLab-specific changes:

* Use `DEBIAN_FRONTEND=noninteractive` to reduce noise
* Use --no-install-recommends to avoid installing unnecessary packages
* Filter out uninteresting lines on install

Note: `DEBIAN_FRONTEND` does not appear to be needed in the default
GitHub runner container and not many packages are currently being
downloaded/installed in them, so do the above changes only jobs that use
custom Docker images.
This commit is contained in:
Kelvin M. Klann 2023-04-25 13:42:08 -03:00
parent 0585d78d11
commit 15e40e9ae4
3 changed files with 37 additions and 23 deletions

View file

@ -62,9 +62,11 @@ jobs:
github.com:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: update package information
run: sudo apt-get update
run: sudo apt-get update -qy
- name: install dependencies
run: sudo apt-get install libapparmor-dev libselinux1-dev
run: >
sudo apt-get install -qy
libapparmor-dev libselinux1-dev
- name: print env
run: ./ci/printenv.sh
- name: configure
@ -90,9 +92,11 @@ jobs:
github.com:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: update package information
run: sudo apt-get update
run: sudo apt-get update -qy
- name: install clang-tools-14 and dependencies
run: sudo apt-get install clang-tools-14 libapparmor-dev libselinux1-dev
run: >
sudo apt-get install -qy
clang-tools-14 libapparmor-dev libselinux1-dev
- name: print env
run: ./ci/printenv.sh
- name: configure
@ -114,9 +118,9 @@ jobs:
github.com:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: update package information
run: sudo apt-get update
run: sudo apt-get update -qy
- name: install cppcheck
run: sudo apt-get install cppcheck
run: sudo apt-get install -qy cppcheck
- run: cppcheck --version
- name: cppcheck
run: >
@ -136,9 +140,9 @@ jobs:
github.com:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: update package information
run: sudo apt-get update
run: sudo apt-get update -qy
- name: install cppcheck
run: sudo apt-get install cppcheck
run: sudo apt-get install -qy cppcheck
- run: cppcheck --version
- name: cppcheck
run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance .
@ -154,9 +158,9 @@ jobs:
github.com:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: update package information
run: sudo apt-get update
run: sudo apt-get update -qy
- name: install dependencies
run: sudo apt-get install codespell
run: sudo apt-get install -qy codespell
- run: codespell --version
- name: codespell
run: make codespell

View file

@ -63,10 +63,10 @@ jobs:
yahoo.com:1025
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: update package information
run: sudo apt-get update
run: sudo apt-get update -qy
- name: install dependencies
run: >
sudo apt-get install
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec whois
bridge-utils
- name: print env

View file

@ -8,11 +8,14 @@
build_ubuntu_package:
image: ubuntu:rolling
variables:
DEBIAN_FRONTEND: noninteractive
script:
- apt-get update -qq
- apt-get update -qy
- >
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq
build-essential lintian libapparmor-dev pkg-config gawk
apt-get install --no-install-recommends -qy
build-essential fakeroot lintian libapparmor-dev pkg-config gawk
| grep -Ev '^(Selecting|Preparing to unpack|Unpacking)'
- ./ci/printenv.sh
- ./configure || (cat config.log; exit 1)
- make deb
@ -21,11 +24,14 @@ build_ubuntu_package:
build_debian_package:
image: debian:buster
variables:
DEBIAN_FRONTEND: noninteractive
script:
- apt-get update -qq
- apt-get update -qy
- >
apt-get install -y -qq
build-essential lintian libapparmor-dev pkg-config gawk
apt-get install --no-install-recommends -qy
build-essential fakeroot lintian libapparmor-dev pkg-config gawk
| grep -Ev '^(Selecting|Preparing to unpack|Unpacking)'
- ./ci/printenv.sh
- ./configure || (cat config.log; exit 1)
- make deb
@ -68,11 +74,14 @@ build_src_package:
build_no_apparmor:
image: ubuntu:latest
variables:
DEBIAN_FRONTEND: noninteractive
script:
- apt-get update -qq
- apt-get update -qy
- >
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq
build-essential lintian pkg-config gawk
apt-get install --no-install-recommends -qy
build-essential fakeroot lintian pkg-config gawk
| grep -Ev '^(Selecting|Preparing to unpack|Unpacking)'
- ./ci/printenv.sh
- ./configure || (cat config.log; exit 1)
- make dist
@ -86,6 +95,7 @@ debian_ci:
variables:
DEBFULLNAME: "$GITLAB_USER_NAME"
DEBEMAIL: "$GITLAB_USER_EMAIL"
DEBIAN_FRONTEND: noninteractive
before_script:
- git checkout -B ci_build "$CI_COMMIT_SHA"
- gitlab-ci-enable-sid
@ -95,7 +105,7 @@ debian_ci:
deb-src http://deb.debian.org/debian sid main
deb-src http://deb.debian.org/debian experimental main
EOF
- apt-get update
- apt-get update -qy
- git config user.name "$DEBFULLNAME"
- git config user.email "$DEBEMAIL"
- |
@ -116,7 +126,7 @@ debian_ci:
- git commit -m 'add debian/'
- export CI_COMMIT_SHA="$(git rev-parse HEAD)"
script:
- apt-get --no-install-recommends install -y -qq gawk
- apt-get install --no-install-recommends -qy gawk
- ./ci/printenv.sh
- gitlab-ci-git-buildpackage
- gitlab-ci-lintian