Skip to content

Commit

Permalink
GHA: tidy up apt commands
Browse files Browse the repository at this point in the history
- drop `--quiet 2` option where used, to have uniform output.
- replace `apt` with `apt-get` in one job. sync options with rest.
- replace deprecated `apt-key` command with the alternative recommended
  by `apt-key(8)`.
- drop stray `cd /tmp`, no longer needed after migrating to GHA.
- shorten `--option Dpkg::Use-Pty=0` to `-o Dpkg::Use-Pty=0`.
- add `-o Dpkg::Use-Pty=0` to hide `apt-get` progress bars taking
  vertical log space, where missing.
- drop `-y --no-install-suggests --no-install-recommends` `apt-get`
  options. They are the default in the ubuntu-24.04 image.
- GHA/distcheck: move `name:` to top in steps where not there.
- scripts/cijobs.pl: catch `apt-get` lines with the `-o` option.

Closes curl#16127
  • Loading branch information
vszakats committed Jan 30, 2025
1 parent 11ea103 commit b13e906
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 51 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/checkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ jobs:
# - name: install prereqs
# run: |
# sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
# sudo apt-get update -y
# sudo apt-get install -y --no-install-suggests --no-install-recommends \
# python3-proselint
# sudo apt-get -o Dpkg::Use-Pty=0 update
# sudo apt-get -o Dpkg::Use-Pty=0 install python3-proselint
#
# # config file help: https://github.com/amperser/proselint/
# - name: create proselint config
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/checksrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -y
sudo apt-get install -y --no-install-suggests --no-install-recommends \
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
codespell python3-pip python3-networkx python3-pydot python3-yaml \
python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
python3-typing-extensions python3-libcst python3-impacket \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/configure-vs-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
TRIPLET: 'x86_64-w64-mingw32'
steps:
- name: 'install packages'
run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install mingw-w64
run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
Expand Down
43 changes: 21 additions & 22 deletions .github/workflows/distcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ jobs:
with:
persist-credentials: false

- run: sudo apt-get purge -y curl libcurl4 libcurl4-doc
name: 'remove preinstalled curl libcurl4{-doc}'
- name: 'remove preinstalled curl libcurl4{-doc}'
run: sudo apt-get -o Dpkg::Use-Pty=0 purge curl libcurl4 libcurl4-doc

- run: autoreconf -fi
name: 'autoreconf'
- name: 'autoreconf'
run: autoreconf -fi

- run: ./configure --without-ssl --without-libpsl
name: 'configure'
- name: 'configure'
run: ./configure --without-ssl --without-libpsl

- run: make V=1
name: 'make'
- name: 'make'
run: make V=1

- name: 'maketgz'
run: |
SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97
run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97

- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: 'release-tgz'
path: 'curl-99.98.97.tar.gz'
retention-days: 1

- run: |
- name: 'verify in-tree configure build including install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
Expand All @@ -62,7 +62,6 @@ jobs:
# basic check of the installed files
bash scripts/installcheck.sh $HOME/temp
rm -rf curl-99.98.97
name: 'verify in-tree configure build including install'
verify-out-of-tree-docs:
runs-on: ubuntu-latest
Expand All @@ -73,7 +72,8 @@ jobs:
with:
name: 'release-tgz'

- run: |
- name: 'verify out-of-tree configure build including docs'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
Expand All @@ -85,7 +85,6 @@ jobs:
popd
rm -rf build
rm -rf curl-99.98.97
name: 'verify out-of-tree configure build including docs'
verify-out-of-tree-autotools-debug:
runs-on: ubuntu-latest
Expand All @@ -96,7 +95,8 @@ jobs:
with:
name: 'release-tgz'

- run: |
- name: 'verify out-of-tree autotools debug build'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
Expand All @@ -106,7 +106,6 @@ jobs:
make -j5
make -j5 test-ci
make -j5 install
name: 'verify out-of-tree autotools debug build'
verify-out-of-tree-cmake:
runs-on: ubuntu-latest
Expand All @@ -117,13 +116,13 @@ jobs:
with:
name: 'release-tgz'

- run: |
- name: 'verify out-of-tree cmake build'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF
make -C build -j5
name: 'verify out-of-tree cmake build'
missing-files:
runs-on: ubuntu-latest
Expand All @@ -148,11 +147,11 @@ jobs:
with:
persist-credentials: false

- run: sudo apt-get purge -y curl libcurl4 libcurl4-doc
name: 'remove preinstalled curl libcurl4{-doc}'
- name: 'remove preinstalled curl libcurl4{-doc}'
run: sudo apt-get -o Dpkg::Use-Pty=0 purge curl libcurl4 libcurl4-doc

- run: ./scripts/dmaketgz 9.10.11
name: 'generate release tarballs'
- name: 'generate release tarballs'
run: ./scripts/dmaketgz 9.10.11

- name: 'verify release tarballs'
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/http3-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ jobs:
if: steps.settings.outputs.needs-build == 'true'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -y
sudo apt-get install -y --no-install-suggests --no-install-recommends \
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
Expand Down Expand Up @@ -289,8 +289,8 @@ jobs:
- name: 'install prereqs'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -y
sudo apt-get install -y --no-install-suggests --no-install-recommends \
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake ninja-build pkgconf stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/linux-old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ jobs:
# Remember, this shell is dash, not bash
run: |
sed -E -i -e s@[a-z]+\.debian\.org/@archive.debian.org/debian-archive/@ -e '/ stretch-updates /d' /etc/apt/sources.list
apt-get update
apt-get -o Dpkg::Use-Pty=0 update
# See comment above if this fails after 2025-05-20
apt-get install -y --no-install-suggests --no-install-recommends httrack
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends httrack
httrack --get https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb
dpkg -i freexian-archive-keyring_2022.06.08_all.deb
echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list
apt-get update
apt-get install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libssl1.0-dev libssh-dev libssh2-1-dev libc-ares-dev heimdal-dev libldap2-dev librtmp-dev stunnel4 groff
apt-get -o Dpkg::Use-Pty=0 update
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libssl1.0-dev libssh-dev libssh2-1-dev libc-ares-dev heimdal-dev libldap2-dev librtmp-dev stunnel4 groff
# GitHub's actions/checkout needs a newer glibc. This one is the
# latest available for buster, the next stable release after stretch.
httrack --get https://security.debian.org/debian-security/pool/updates/main/g/glibc/libc6_2.28-10+deb10u4_amd64.deb
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ jobs:
if: matrix.build.container == null && !contains(matrix.build.name, 'i686')
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -y
sudo apt-get install -y --no-install-suggests --no-install-recommends \
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf ninja-build \
${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' && 'stunnel4' || '' }} \
libpsl-dev libbrotli-dev libzstd-dev \
Expand All @@ -314,8 +314,8 @@ jobs:
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo apt-get update -y
sudo apt-get install -y --no-install-suggests --no-install-recommends \
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 \
${{ matrix.build.install_packages }}
Expand All @@ -324,8 +324,7 @@ jobs:
- name: 'install prereqs for pytest'
if: contains(matrix.build.install_steps, 'pytest')
run: |
sudo apt-get install -y --no-install-suggests --no-install-recommends \
apache2 apache2-dev libnghttp2-dev vsftpd
sudo apt-get -o Dpkg::Use-Pty=0 install apache2 apache2-dev libnghttp2-dev vsftpd
- name: 'install dependencies'
if: startsWith(matrix.build.container, 'alpine')
Expand Down Expand Up @@ -437,7 +436,7 @@ jobs:
cache-name: cache-wolfssh
with:
path: ~/wolfssh
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }}-${{ env.wolfssh-version }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssh-version }}-${{ env.wolfssl-version }}

- name: 'build wolfssh'
if: contains(matrix.build.install_steps, 'wolfssh') && steps.cache-wolfssh.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -582,10 +581,9 @@ jobs:
- name: 'install Intel compilers'
if: contains(matrix.build.install_steps, 'intel')
run: |
cd /tmp
curl -sSf --compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add -
curl -sSf --compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo tee /etc/apt/trusted.gpg.d/intel-sw.asc >/dev/null
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt install --no-install-recommends intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
sudo apt-get -o Dpkg::Use-Pty=0 install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/non-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ jobs:
timeout-minutes: 5
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -y
sudo apt-get install -y --no-install-suggests --no-install-recommends nasm
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install nasm
- name: 'vcpkg build'
if: ${{ matrix.install }}
Expand Down Expand Up @@ -606,7 +606,7 @@ jobs:
fail-fast: false
steps:
- name: 'install packages'
run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install libfl2 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
run: sudo apt-get -o Dpkg::Use-Pty=0 install libfl2 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}

- name: 'cache compiler (djgpp)'
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ jobs:
TRIPLET: 'x86_64-w64-mingw32'
steps:
- name: 'install packages'
run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
Expand Down
2 changes: 1 addition & 1 deletion scripts/cijobs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sub githubactions {
$m = 0;
$j = 0;
}
elsif($_ =~ /^ - run: .* apt-get install (.*)/) {
elsif($_ =~ /^ - run: .* apt-get .* install (.*)/) {
$job{'install'} = $1;
}
elsif($m >= 0) {
Expand Down

0 comments on commit b13e906

Please sign in to comment.