Skip to content

Commit 6a8eff8

Browse files
committed
GitHub actions: avoid trashing caches
1. We must use the same build configuration when sharing a particular cache. 2. Don't create additional cache entries when we can safely use one of the existing ones.
1 parent 58ab591 commit 6a8eff8

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.github/workflows/build-and-test-Linux.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ jobs:
2020
DEBIAN_FRONTEND: noninteractive
2121
run: |
2222
sudo apt-get update
23-
sudo apt-get install --no-install-recommends -y g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache
23+
sudo apt-get install --no-install-recommends -y clang-10 clang++-10 flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache
2424
sudo apt-get install --no-install-recommends -y libssl-dev libelf-dev libudev-dev libpci-dev libiberty-dev autoconf
2525
sudo apt-get install --no-install-recommends -y gawk jq
2626
2727
- name: Prepare ccache
2828
uses: actions/cache@v3
2929
with:
3030
path: .ccache
31-
key: ${{ runner.os }}-20.04-make-${{ github.ref }}-${{ github.sha }}-KERNEL
31+
key: ${{ runner.os }}-20.04-make-clang-${{ github.ref }}-${{ github.sha }}-KERNEL
3232
restore-keys: |
33-
${{ runner.os }}-20.04-make-${{ github.ref }}
34-
${{ runner.os }}-20.04-make
33+
${{ runner.os }}-20.04-make-clang-${{ github.ref }}
34+
${{ runner.os }}-20.04-make-clang
3535
- name: ccache environment
3636
run: |
3737
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build CBMC tools
4242
run: |
4343
make -C src minisat2-download
44-
make -C src CXX='ccache /usr/bin/g++' cbmc.dir goto-cc.dir goto-diff.dir -j2
44+
make -C src CXX='ccache /usr/bin/clang++' cbmc.dir goto-cc.dir goto-diff.dir -j2
4545
- name: Print ccache stats
4646
run: ccache -s
4747

.github/workflows/build-and-test-Xen.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
sudo apt-get update
2222
sudo apt-get install --no-install-recommends -y build-essential git flex bison software-properties-common curl python
2323
sudo apt-get install --no-install-recommends -y bin86 gdb bcc liblzma-dev python-dev gettext iasl uuid-dev libncurses5-dev libncursesw5-dev pkg-config
24-
sudo apt-get install --no-install-recommends -y libgtk2.0-dev libyajl-dev time ccache
24+
sudo apt-get install --no-install-recommends -y libgtk2.0-dev libyajl-dev time ccache clang-10 clang++-10
2525
2626
- name: Prepare ccache
2727
uses: actions/cache@v3
2828
with:
2929
path: .ccache
30-
key: ${{ runner.os }}-20.04-make-${{ github.ref }}-${{ github.sha }}-XEN
30+
key: ${{ runner.os }}-20.04-make-clang-${{ github.ref }}-${{ github.sha }}-XEN
3131
restore-keys: |
32-
${{ runner.os }}-20.04-make-${{ github.ref }}
33-
${{ runner.os }}-20.04-make
32+
${{ runner.os }}-20.04-make-clang-${{ github.ref }}
33+
${{ runner.os }}-20.04-make-clang
3434
- name: ccache environment
3535
run: |
3636
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
@@ -40,7 +40,7 @@ jobs:
4040
- name: Build CBMC tools
4141
run: |
4242
make -C src minisat2-download
43-
make -C src CXX='ccache /usr/bin/g++' cbmc.dir goto-cc.dir goto-diff.dir -j2
43+
make -C src CXX='ccache /usr/bin/clang++' cbmc.dir goto-cc.dir goto-diff.dir -j2
4444
- name: Print ccache stats
4545
run: ccache -s
4646

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ jobs:
174174
uses: actions/cache@v3
175175
with:
176176
path: .ccache
177-
key: ${{ runner.os }}-20.04-make-clang-smt-z3-${{ github.ref }}-${{ github.sha }}-PR
177+
key: ${{ runner.os }}-20.04-make-clang-${{ github.ref }}-${{ github.sha }}-PR
178178
restore-keys: |
179-
${{ runner.os }}-20.04-make-clang-smt-z3-${{ github.ref }}
180-
${{ runner.os }}-20.04-make-clang-smt-z3
179+
${{ runner.os }}-20.04-make-clang-${{ github.ref }}
180+
${{ runner.os }}-20.04-make-clang
181181
- name: ccache environment
182182
run: |
183183
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
@@ -335,7 +335,7 @@ jobs:
335335
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
336336
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
337337
- name: Configure using CMake
338-
run: cmake -H. -Bbuild -G Ninja
338+
run: cmake -H. -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
339339
- name: Zero ccache stats and limit in size
340340
run: ccache -z --max-size=500M
341341
- name: Build with Ninja
@@ -381,7 +381,7 @@ jobs:
381381
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
382382
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
383383
- name: Configure using CMake
384-
run: cmake -H. -Bbuild -G Ninja
384+
run: cmake -H. -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
385385
- name: Zero ccache stats and limit in size
386386
run: ccache -z --max-size=500M
387387
- name: Build with Ninja

0 commit comments

Comments
 (0)