From 22b68c6380fbcb52f54845503e52adfd651bbd96 Mon Sep 17 00:00:00 2001 From: mxHuber Date: Tue, 18 Nov 2025 09:17:39 +0100 Subject: [PATCH 1/6] Added workflow code + utility script --- .github/workflows/ci.yml | 81 ++++++++++++++++++++++++++++++++++++++-- utils/getArtifactID.sh | 27 ++++++++++++++ 2 files changed, 104 insertions(+), 4 deletions(-) create mode 100755 utils/getArtifactID.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20130f8156..4435cdb24f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,16 @@ jobs: include: - build: Debug cmake_build_type: Debug - flags: -DPHASAR_ENABLE_SANITIZERS=ON + flags: -DPHASAR_ENABLE_SANITIZERS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - build: Release cmake_build_type: Release - flags: -DPHASAR_ENABLE_DYNAMIC_LOG=OFF -DPHASAR_BUILD_DYNLIB=ON -DPHASAR_ENABLE_SANITIZERS=ON + flags: -DPHASAR_ENABLE_DYNAMIC_LOG=OFF -DPHASAR_BUILD_DYNLIB=ON -DPHASAR_ENABLE_SANITIZERS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - build: DebugLibdeps cmake_build_type: Debug - flags: -DPHASAR_DEBUG_LIBDEPS=ON -DBUILD_SHARED_LIBS=ON + flags: -DPHASAR_DEBUG_LIBDEPS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - build: DebugCov cmake_build_type: Debug - flags: -DCODE_COVERAGE=ON + flags: -DCODE_COVERAGE=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache extra_dependencies: llvm-19 # For coverage exclude: - os: ubuntu-24.04-arm @@ -52,6 +52,43 @@ jobs: run: | ./utils/InstallAptDependencies.sh --noninteractive tzdata ${{ matrix.compiler[2] }} ${{ matrix.extra_dependencies }} + + - name: Download release build artifacts + if: matrix.build == 'Release' + shell: bash + run: | + name: ReleaseArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + + - name: Download debug build artifacts + if: matrix.build == 'Debug' + uses: actions/upload-artifact@v4 + with: + name: DebugArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + + - name: Download debuglibdeps build artifacts + if: matrix.build == 'DebugLibdeps' + uses: actions/upload-artifact@v4 + with: + name: DebugLibdepsArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + + - name: Download debugcov build artifacts + if: matrix.build == 'DebugCov' + uses: actions/upload-artifact@v4 + with: + name: DebugCovArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + - name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }} env: CXX: ${{ matrix.compiler[0] }} @@ -66,6 +103,42 @@ jobs: -G Ninja ninja -C build + - name: Upload release build artifacts + if: matrix.build == 'Release' + uses: actions/upload-artifact@v4 + with: + name: ReleaseArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + + - name: Upload debug build artifacts + if: matrix.build == 'Debug' + uses: actions/upload-artifact@v4 + with: + name: DebugArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + + - name: Upload debuglibdeps build artifacts + if: matrix.build == 'DebugLibdeps' + uses: actions/upload-artifact@v4 + with: + name: DebugLibdepsArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + + - name: Upload debugcov build artifacts + if: matrix.build == 'DebugCov' + uses: actions/upload-artifact@v4 + with: + name: DebugCovArtifact + path: ~/.cache/ccache + if-no-files-found: error + retention-days: 7 + - name: Run Unittests shell: bash run: | diff --git a/utils/getArtifactID.sh b/utils/getArtifactID.sh new file mode 100755 index 0000000000..16603522b7 --- /dev/null +++ b/utils/getArtifactID.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# TODO: get artifacts for all build types (Release, Debug, DebugLibdeps, DebugCov) + +# Get current repository name (OWNER) (i.e. secure-software-engineering, fabianbs96, etc) +REPOS="$(git remote -v)" +SPLITREPOS=(${REPOS//// }) +REPOGITLINK=${SPLITREPOS[1]} +SPLITREPOGITLINK=(${REPOGITLINK//:/ }) +REPONAME=(${SPLITREPOGITLINK[1]}) + +# Download artifacts info list + +curl https://api.github.com/repos/$REPONAME/phasar/actions/artifacts > artifacts-info.txt + +# Get latest artifact (Should always be upper most one) + +URLLINE="$(grep -nr artifacts-info.txt -e 'url' | head -1)" +URLLINESPLIT=(${URLLINE//\"/ }) +ARTLINK=(${URLLINESPLIT[3]}) +echo ${ARTLINK} + +# TODO: download the artifact data into ~/.cache/ccache +# TODO: ARTLINK apparently isn't what we're looking for here, it only downloads this part of +# the artifact info list + +curl $ARTLINK > test.txt From c8740cf00fbeb94ebf881f5ff8ae30ac65527df8 Mon Sep 17 00:00:00 2001 From: mxHuber Date: Mon, 1 Dec 2025 11:29:58 +0100 Subject: [PATCH 2/6] Revert "Added workflow code + utility script" This reverts commit 22b68c6380fbcb52f54845503e52adfd651bbd96. --- .github/workflows/ci.yml | 81 ++-------------------------------------- utils/getArtifactID.sh | 27 -------------- 2 files changed, 4 insertions(+), 104 deletions(-) delete mode 100755 utils/getArtifactID.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4435cdb24f..20130f8156 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,16 @@ jobs: include: - build: Debug cmake_build_type: Debug - flags: -DPHASAR_ENABLE_SANITIZERS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + flags: -DPHASAR_ENABLE_SANITIZERS=ON - build: Release cmake_build_type: Release - flags: -DPHASAR_ENABLE_DYNAMIC_LOG=OFF -DPHASAR_BUILD_DYNLIB=ON -DPHASAR_ENABLE_SANITIZERS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + flags: -DPHASAR_ENABLE_DYNAMIC_LOG=OFF -DPHASAR_BUILD_DYNLIB=ON -DPHASAR_ENABLE_SANITIZERS=ON - build: DebugLibdeps cmake_build_type: Debug - flags: -DPHASAR_DEBUG_LIBDEPS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + flags: -DPHASAR_DEBUG_LIBDEPS=ON -DBUILD_SHARED_LIBS=ON - build: DebugCov cmake_build_type: Debug - flags: -DCODE_COVERAGE=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + flags: -DCODE_COVERAGE=ON extra_dependencies: llvm-19 # For coverage exclude: - os: ubuntu-24.04-arm @@ -52,43 +52,6 @@ jobs: run: | ./utils/InstallAptDependencies.sh --noninteractive tzdata ${{ matrix.compiler[2] }} ${{ matrix.extra_dependencies }} - - - name: Download release build artifacts - if: matrix.build == 'Release' - shell: bash - run: | - name: ReleaseArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - - name: Download debug build artifacts - if: matrix.build == 'Debug' - uses: actions/upload-artifact@v4 - with: - name: DebugArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - - name: Download debuglibdeps build artifacts - if: matrix.build == 'DebugLibdeps' - uses: actions/upload-artifact@v4 - with: - name: DebugLibdepsArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - - name: Download debugcov build artifacts - if: matrix.build == 'DebugCov' - uses: actions/upload-artifact@v4 - with: - name: DebugCovArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }} env: CXX: ${{ matrix.compiler[0] }} @@ -103,42 +66,6 @@ jobs: -G Ninja ninja -C build - - name: Upload release build artifacts - if: matrix.build == 'Release' - uses: actions/upload-artifact@v4 - with: - name: ReleaseArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - - name: Upload debug build artifacts - if: matrix.build == 'Debug' - uses: actions/upload-artifact@v4 - with: - name: DebugArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - - name: Upload debuglibdeps build artifacts - if: matrix.build == 'DebugLibdeps' - uses: actions/upload-artifact@v4 - with: - name: DebugLibdepsArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - - name: Upload debugcov build artifacts - if: matrix.build == 'DebugCov' - uses: actions/upload-artifact@v4 - with: - name: DebugCovArtifact - path: ~/.cache/ccache - if-no-files-found: error - retention-days: 7 - - name: Run Unittests shell: bash run: | diff --git a/utils/getArtifactID.sh b/utils/getArtifactID.sh deleted file mode 100755 index 16603522b7..0000000000 --- a/utils/getArtifactID.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# TODO: get artifacts for all build types (Release, Debug, DebugLibdeps, DebugCov) - -# Get current repository name (OWNER) (i.e. secure-software-engineering, fabianbs96, etc) -REPOS="$(git remote -v)" -SPLITREPOS=(${REPOS//// }) -REPOGITLINK=${SPLITREPOS[1]} -SPLITREPOGITLINK=(${REPOGITLINK//:/ }) -REPONAME=(${SPLITREPOGITLINK[1]}) - -# Download artifacts info list - -curl https://api.github.com/repos/$REPONAME/phasar/actions/artifacts > artifacts-info.txt - -# Get latest artifact (Should always be upper most one) - -URLLINE="$(grep -nr artifacts-info.txt -e 'url' | head -1)" -URLLINESPLIT=(${URLLINE//\"/ }) -ARTLINK=(${URLLINESPLIT[3]}) -echo ${ARTLINK} - -# TODO: download the artifact data into ~/.cache/ccache -# TODO: ARTLINK apparently isn't what we're looking for here, it only downloads this part of -# the artifact info list - -curl $ARTLINK > test.txt From 2005e8bcde29b9d8032c9a0ccd01154335435209 Mon Sep 17 00:00:00 2001 From: mxHuber Date: Mon, 1 Dec 2025 11:39:59 +0100 Subject: [PATCH 3/6] Testing hendrikmuhs ccache github action --- .github/workflows/ci.yml | 5 +++++ utils/InstallAptDependencies.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20130f8156..32c03ba6e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,9 @@ jobs: fetch-depth: 0 submodules: recursive + - name: ccache # This should always come after the actions/checkout step. + uses: hendrikmuhs/ccache-action@v1.2 + - name: Install Phasar Dependencies shell: bash run: | @@ -60,6 +63,8 @@ jobs: run: | cmake -S . -B build \ -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DBUILD_PHASAR_CLANG=OFF \ -DPHASAR_USE_Z3=ON \ ${{ matrix.flags }} \ diff --git a/utils/InstallAptDependencies.sh b/utils/InstallAptDependencies.sh index 3376cfcd1a..96a792c892 100755 --- a/utils/InstallAptDependencies.sh +++ b/utils/InstallAptDependencies.sh @@ -27,7 +27,7 @@ additional_dependencies=("$@") "clang-$LLVM_IR_VERSION" # compiler for IR "libclang-rt-$LLVM_IR_VERSION-dev" # ASAN libz3-dev libssl-dev "libclang-$LLVM_IR_VERSION-dev" "libclang-common-$LLVM_IR_VERSION-dev" # optional build deps - zlib1g-dev libzstd-dev "llvm-$LLVM_IR_VERSION-dev" # build deps + zlib1g-dev libzstd-dev ccache "llvm-$LLVM_IR_VERSION-dev" # build deps ) From 7bdd78c74f613ef4f03624d898769515286323b5 Mon Sep 17 00:00:00 2001 From: mxHuber Date: Tue, 2 Dec 2025 17:38:11 +0100 Subject: [PATCH 4/6] added key so different runs have their own ccache + moved ccache install --- .github/workflows/ci.yml | 10 ++++++---- utils/InstallAptDependencies.sh | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32c03ba6e2..a5ea8a0c72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,13 +47,10 @@ jobs: fetch-depth: 0 submodules: recursive - - name: ccache # This should always come after the actions/checkout step. - uses: hendrikmuhs/ccache-action@v1.2 - - name: Install Phasar Dependencies shell: bash run: | - ./utils/InstallAptDependencies.sh --noninteractive tzdata ${{ matrix.compiler[2] }} ${{ matrix.extra_dependencies }} + ./utils/InstallAptDependencies.sh --noninteractive tzdata ccache ${{ matrix.compiler[2] }} ${{ matrix.extra_dependencies }} - name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }} env: @@ -71,6 +68,11 @@ jobs: -G Ninja ninja -C build + - name: ccache # This should always come after the actions/checkout step. + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build }} + - name: Run Unittests shell: bash run: | diff --git a/utils/InstallAptDependencies.sh b/utils/InstallAptDependencies.sh index 96a792c892..3376cfcd1a 100755 --- a/utils/InstallAptDependencies.sh +++ b/utils/InstallAptDependencies.sh @@ -27,7 +27,7 @@ additional_dependencies=("$@") "clang-$LLVM_IR_VERSION" # compiler for IR "libclang-rt-$LLVM_IR_VERSION-dev" # ASAN libz3-dev libssl-dev "libclang-$LLVM_IR_VERSION-dev" "libclang-common-$LLVM_IR_VERSION-dev" # optional build deps - zlib1g-dev libzstd-dev ccache "llvm-$LLVM_IR_VERSION-dev" # build deps + zlib1g-dev libzstd-dev "llvm-$LLVM_IR_VERSION-dev" # build deps ) From 5d8e396ba439eb3adf4f95155143e349f7562e20 Mon Sep 17 00:00:00 2001 From: mxHuber Date: Thu, 4 Dec 2025 10:27:46 +0100 Subject: [PATCH 5/6] Testing symlink variant --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5ea8a0c72..d9942968fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,6 +72,7 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build }} + create-symlink: true - name: Run Unittests shell: bash From 3f93f2738dca51fc7de4ef30f86283850392e07e Mon Sep 17 00:00:00 2001 From: mxHuber Date: Thu, 4 Dec 2025 14:05:29 +0100 Subject: [PATCH 6/6] Moving ccache step with key directly after checkout --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9942968fc..d72879b79b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,11 @@ jobs: fetch-depth: 0 submodules: recursive + - name: ccache # This should always come after the actions/checkout step. + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build }} + - name: Install Phasar Dependencies shell: bash run: | @@ -68,12 +73,6 @@ jobs: -G Ninja ninja -C build - - name: ccache # This should always come after the actions/checkout step. - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build }} - create-symlink: true - - name: Run Unittests shell: bash run: |