]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
gh actions: enable ccache 10710/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 10 Sep 2021 11:32:40 +0000 (13:32 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 13 Sep 2021 10:11:12 +0000 (12:11 +0200)
.github/workflows/build-and-test-all.yml
build-scripts/gh-actions-setup-inv
tasks.py

index 317e67a6d5d4a3379d9164656d829104bca522c2..5a4e365f38b1cf4d737db5315c94a2f43eee9f27 100644 (file)
@@ -19,6 +19,17 @@ jobs:
         with:
           fetch-depth: 5
           submodules: recursive
+      - name: get timestamp for cache
+        id: get-stamp
+        run: |
+          echo "::set-output name=stamp::$(/bin/date +%s)"
+        shell: bash
+      - name: let GitHub cache our ccache data
+        uses: actions/cache@v2
+        with:
+          path: ~/.ccache
+          key: auth-ccache-${{ steps.get-stamp.outputs.stamp }}
+          restore-keys: auth-ccache-
       - run: build-scripts/gh-actions-setup-inv  # this runs apt update+upgrade
       - run: inv install-clang
       - run: inv install-auth-build-deps
@@ -29,6 +40,7 @@ jobs:
       - run: inv ci-auth-install-remotebackend-ruby-deps
       - run: inv ci-auth-run-unit-tests
       - run: inv ci-make-install
+      - run: ccache -s
       - name: Store the binaries
         uses: actions/upload-artifact@v2 # this takes 30 seconds, maybe we want to tar
         with:
@@ -50,6 +62,17 @@ jobs:
         with:
           fetch-depth: 5
           submodules: recursive
+      - name: get timestamp for cache
+        id: get-stamp
+        run: |
+          echo "::set-output name=stamp::$(/bin/date +%s)"
+        shell: bash
+      - name: let GitHub cache our ccache data
+        uses: actions/cache@v2
+        with:
+          path: ~/.ccache
+          key: recursor-ccache-${{ steps.get-stamp.outputs.stamp }}
+          restore-keys: recursor-ccache-
       - run: ../../build-scripts/gh-actions-setup-inv  # this runs apt update+upgrade
       - run: inv apt-fresh
       - run: inv install-clang
@@ -60,6 +83,7 @@ jobs:
       # FIXME: save ccache here?
       - run: inv ci-rec-run-unit-tests
       - run: inv ci-make-install
+      - run: ccache -s
       - name: Store the binaries
         uses: actions/upload-artifact@v2 # this takes 30 seconds, maybe we want to tar
         with:
@@ -85,6 +109,17 @@ jobs:
         with:
           fetch-depth: 5
           submodules: recursive
+      - name: get timestamp for cache
+        id: get-stamp
+        run: |
+          echo "::set-output name=stamp::$(/bin/date +%s)"
+        shell: bash
+      - name: let GitHub cache our ccache data
+        uses: actions/cache@v2
+        with:
+          path: ~/.ccache
+          key: dnsdist-${{ matrix.sanitizers }}-ccache-${{ steps.get-stamp.outputs.stamp }}
+          restore-keys: dnsdist-${{ matrix.sanitizers }}-ccache-
       - run: ../../build-scripts/gh-actions-setup-inv  # this runs apt update+upgrade
       - run: inv apt-fresh
       - run: inv install-clang
@@ -95,6 +130,7 @@ jobs:
       # FIXME: save ccache here?
       - run: inv ci-dnsdist-run-unit-tests
       - run: inv ci-make-install
+      - run: ccache -s
       - name: Store the binaries
         uses: actions/upload-artifact@v2 # this takes 30 seconds, maybe we want to tar
         with:
index de9bf0c4b349f84e84da54cfcc0b37eeb6c3b558..02e5a231e237d7e888af5aca13d0dadde63d8d94 100755 (executable)
@@ -2,4 +2,4 @@
 sudo apt-get update
 sudo apt-get -qq -y dist-upgrade
 sudo apt-get -qq -y --no-install-recommends install python3-pip
-sudo pip3 install git+https://github.com/pyinvoke/invoke@faa5728a6f76199a3da1750ed952e7efee17c1da
\ No newline at end of file
+sudo pip3 install git+https://github.com/pyinvoke/invoke@faa5728a6f76199a3da1750ed952e7efee17c1da
index aafa977514e3086d64f492568668c24bdd4186c2..e66e394bb504182894cb5d3c49b6e35ed3076594 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -6,6 +6,7 @@ import sys
 import time
 
 all_build_deps = [
+    'ccache',
     'libboost-all-dev',
     'libluajit-5.1-dev',
     'libsodium-dev',
@@ -366,3 +367,10 @@ def test_dnsdist(c):
     c.run('ls -al /var/agentx/master')
     with c.cd('regression-tests.dnsdist'):
         c.run('DNSDISTBIN=/opt/dnsdist/bin/dnsdist ./runtests')
+
+# this is run always
+def setup():
+    if '/usr/lib/ccache' not in os.environ['PATH']:
+        os.environ['PATH']='/usr/lib/ccache:'+os.environ['PATH']
+
+setup()