From 60693ec37f9c4e35a9843eb28f777903c9dffcd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Uzarski?= Date: Mon, 18 Nov 2024 12:52:12 +0100 Subject: [PATCH 1/2] ci: add comment on how apt cache refreshing works there --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 7c2d6b34..218fb4c4 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,8 @@ clean: update-apt-cache-if-needed: @{\ + # It searches for a file that is at most one day old.\ + # If there is no such file, executes apt update.\ @sudo find /var/cache/apt -type f -mtime -1 2>/dev/null | grep -c "" 2>/dev/null | grep 0 >/dev/null 2>&1 || (\ echo "Apt cache is outdated, update it.";\ sudo apt-get update || true;\ From 5e72765593675f9a2f7df495cd20a8e451977be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Uzarski?= Date: Mon, 18 Nov 2024 13:35:49 +0100 Subject: [PATCH 2/2] ci: update apt cache in each job It looks like `update-apt-cache-if-needed` from Makefile does not always recognizes that apt cache needs to be updated during CI. We adjust an explicit step of updating apt cache to each job. I decided to retain the `update-apt-cache-if-needed` in Makefile, since it may be useful for local development. --- .github/workflows/build-lint-and-test.yml | 9 +++++++++ .github/workflows/pkg.yml | 3 +++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/build-lint-and-test.yml b/.github/workflows/build-lint-and-test.yml index c06fc7bb..615ddbc0 100644 --- a/.github/workflows/build-lint-and-test.yml +++ b/.github/workflows/build-lint-and-test.yml @@ -25,6 +25,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + + - name: Update apt cache + run: sudo apt-get update -y - name: Install dependencies run: make install-build-dependencies @@ -66,6 +69,9 @@ jobs: with: python-version: '3.11' + - name: Update apt cache + run: sudo apt-get update -y + - name: Install CCM run: | make install-ccm-if-missing @@ -165,6 +171,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.11' + + - name: Update apt cache + run: sudo apt-get update -y - name: Install CCM run: make install-ccm-if-missing diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index 97cde88b..b9946199 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -60,5 +60,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Update apt cache + run: sudo apt-get update -y + - name: Build deb package for ${{ matrix.dist-version }} run: ./dist/debian/build_deb.sh --target ${{ matrix.dist-version }}