Skip to content

Commit 4d0c76e

Browse files
committed
CI: speed up gcc and clang-format Ubuntu runs
This is an attempt to speed up the gcc and clang-format CI jobs on the Ubuntu runner, which spends between 2 and 3 minutes on apt-get update and apt-get install. Without apt-get update, the installation of the dependencies (ccache, z3, clang-format) now takes 20 seconds.
1 parent 564222c commit 4d0c76e

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ jobs:
1919
# user input
2020
DEBIAN_FRONTEND: noninteractive
2121
run: |
22-
sudo apt-get update
23-
sudo apt-get install --no-install-recommends -yq gcc gdb g++ jq flex bison libxml2-utils ccache cmake z3
22+
sudo apt-get remove --purge man-db
23+
packages_to_install="ccache z3"
24+
if ! sudo apt-get install --no-install-recommends -yq $packages_to_install ; then
25+
# retry after updating package indices
26+
sudo apt-get update
27+
sudo apt-get install --no-install-recommends -yq $packages_to_install
28+
fi
2429
- name: Confirm z3 solver is available and log the version installed
2530
run: z3 --version
31+
- name: Log the version of gcc
32+
run: gcc --version
2633
- name: Prepare ccache
2734
uses: actions/cache@v4
2835
with:
@@ -77,8 +84,13 @@ jobs:
7784
# user input
7885
DEBIAN_FRONTEND: noninteractive
7986
run: |
80-
sudo apt-get update
81-
sudo apt-get install --no-install-recommends -yq clang-19 clang++-19 gdb jq flex bison libxml2-utils cpanminus ccache z3
87+
sudo apt-get remove --purge man-db
88+
packages_to_install="clang-19 clang++-19 gdb jq flex bison libxml2-utils cpanminus ccache z3"
89+
if ! sudo apt-get install --no-install-recommends -yq $packages_to_install ; then
90+
# retry after updating package indices
91+
sudo apt-get update
92+
sudo apt-get install --no-install-recommends -yq $packages_to_install
93+
fi
8294
cpanm Thread::Pool::Simple
8395
- name: Confirm z3 solver is available and log the version installed
8496
run: z3 --version

.github/workflows/syntax-checks.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ jobs:
1818
# user input
1919
DEBIAN_FRONTEND: noninteractive
2020
run: |
21-
sudo apt-get update
22-
sudo apt-get install --no-install-recommends -yq clang-format-15
21+
sudo apt-get remove --purge man-db
22+
packages_to_install="clang-format-15"
23+
if ! sudo apt-get install --no-install-recommends -yq $packages_to_install ; then
24+
# retry after updating package indices
25+
sudo apt-get update
26+
sudo apt-get install --no-install-recommends -yq $packages_to_install
27+
fi
2328
- name: Check updated lines of code match clang-format-15 style
2429
env:
2530
BASE_BRANCH: ${{ github.base_ref }}

0 commit comments

Comments
 (0)