From 0ee83f4677a16c1a670a0756af6123b03c7fd249 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Fri, 27 Jun 2025 13:27:11 +0200 Subject: [PATCH 01/17] Add a small test project to run codechecker_bazel on --- .github/workflows/patch-test-proj.sh | 67 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 41 +++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 .github/workflows/patch-test-proj.sh diff --git a/.github/workflows/patch-test-proj.sh b/.github/workflows/patch-test-proj.sh new file mode 100644 index 00000000..a3c3bccf --- /dev/null +++ b/.github/workflows/patch-test-proj.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +FORK_REPO="$1" +FORK_BRANCH="$2" + +git clone --recurse https://github.com/jbeder/yaml-cpp.git +cd yaml-cpp +git checkout yaml-cpp-0.7.0 + +# Specify bazel version for bazelisk +echo "6.5.0" > .bazelversion + +# Add codechecker to the project +cat <> BUILD.bazel +#------------------------------------------------------- + +# codechecker rules +load( + "@bazel_codechecker//src:codechecker.bzl", + "codechecker_test", +) +load( + "@bazel_codechecker//src:code_checker.bzl", + "code_checker_test", +) + + +codechecker_test( + name = "codechecker_test_yaml-cpp", + targets = [ + ":yaml-cpp", + ], +) + +code_checker_test( + name = "code_checker_test_yaml-cpp", + targets = [ + ":yaml-cpp", + ], +) + +#------------------------------------------------------- +EOF + +cat <> WORKSPACE +#---------------------------------------------------- + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +git_repository( + name = "bazel_codechecker", + remote = "https://github.com/${FORK_REPO}", + branch = "${FORK_BRANCH}", +) + +load( + "@bazel_codechecker//src:tools.bzl", + "register_default_codechecker", + "register_default_python_toolchain", +) + +register_default_python_toolchain() + +register_default_codechecker() + +#---------------------------------------------------- +EOF \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b20213bb..fd775b36 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,3 +65,44 @@ jobs: run: | cd test python3 test.py -vvv + + small_test: + name: Small Project Test + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set bazel version to 6.5.0 + run: echo "6.5.0" > .bazelversion + + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.15.0 + + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install CodeChecker analyzers + run: | + sudo apt-get update --quiet + sudo apt-get install --no-install-recommends \ + clang \ + clang-tools \ + clang-tidy + + - name: Install CodeChecker + run: pip3 install codechecker + + - name: Patch yaml-cpp + run: | + sh .github/workflows/patch-test-proj.sh ${{ github.repository }} ${{ github.ref }} + + - name: Run Bazel CodeChecker + run: | + cd yaml-cpp + bazel build :codechecker_test_yaml-cpp + + From b66f63468483ab071e535e3b039950d8d7d1fd41 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 7 Jul 2025 13:40:22 +0200 Subject: [PATCH 02/17] Organize enviroment setup into a composite action --- .github/actions/env_setup/action.yml | 29 ++++++++++++++ .github/workflows/test.yml | 58 ++-------------------------- 2 files changed, 33 insertions(+), 54 deletions(-) create mode 100644 .github/actions/env_setup/action.yml diff --git a/.github/actions/env_setup/action.yml b/.github/actions/env_setup/action.yml new file mode 100644 index 00000000..3cba05a3 --- /dev/null +++ b/.github/actions/env_setup/action.yml @@ -0,0 +1,29 @@ +name: 'Setup environment' +description: 'Sets up analyzers, CodeChecker and Bazel' +runs: + using: "composite" + steps: + - name: Set bazel version to 6.5.0 + run: echo "6.5.0" > .bazelversion + shell: bash + + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.15.0 + + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install CodeChecker analyzers + run: | + sudo apt-get update --quiet + sudo apt-get install --no-install-recommends \ + clang \ + clang-tools \ + clang-tidy + shell: bash + + - name: Install CodeChecker + run: pip3 install codechecker + shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fd775b36..4f2e76bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,39 +18,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set bazel version to 6.5.0 - run: echo "6.5.0" > .bazelversion - - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.15.0 - - - name: Install python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install CodeChecker analyzers - run: | - sudo apt-get update --quiet - sudo apt-get install --no-install-recommends \ - clang \ - clang-tools \ - clang-tidy - # The default naming of the clang-extdef-mapping, needed for CTU, is - # installed by clang-tools also contains the major version - # (e.g. clang-extdef-mapping-18), but the bazel rules reference it - # without the version number. To this end, we use update-alternatives - # to rename the binary to omit it. - sudo update-alternatives --install \ - /usr/bin/clang-extdef-mapping \ - clang-extdef-mapping \ - /usr/bin/clang-extdef-mapping-$(clang --version | head -n 1 | - sed -E 's/.*version ([0-9]+)\..*/\1/') \ - 100 - - - - name: Install CodeChecker - run: pip3 install codechecker + - name: Setup environment + uses: ./.github/actions/env_setup - name: Print versions run: | @@ -74,27 +43,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set bazel version to 6.5.0 - run: echo "6.5.0" > .bazelversion - - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.15.0 - - - name: Install python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install CodeChecker analyzers - run: | - sudo apt-get update --quiet - sudo apt-get install --no-install-recommends \ - clang \ - clang-tools \ - clang-tidy - - - name: Install CodeChecker - run: pip3 install codechecker + - name: Setup environment + uses: ./.github/actions/env_setup - name: Patch yaml-cpp run: | From df1183a136863ed7a98f4984dfd9ee08ffed0c97 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 8 Jul 2025 13:41:28 +0200 Subject: [PATCH 03/17] Add distributed run, change names, add cooments --- .github/workflows/test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f2e76bd..23be3173 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,7 @@ jobs: python3 test.py -vvv small_test: + # Test if code runs successfully against a small project name: Small Project Test runs-on: ubuntu-24.04 @@ -46,13 +47,16 @@ jobs: - name: Setup environment uses: ./.github/actions/env_setup - - name: Patch yaml-cpp + - name: Patching codechecker_bazel targets onto yaml-cpp run: | sh .github/workflows/patch-test-proj.sh ${{ github.repository }} ${{ github.ref }} - - name: Run Bazel CodeChecker + - name: Run Monolithic Bazel CodeChecker run: | cd yaml-cpp bazel build :codechecker_test_yaml-cpp - + - name: Run Distributed Bazel CodeChecker + run: | + cd yaml-cpp + bazel build :code_checker_test_yaml-cpp From cc26e41ffe88ef02b9e6094039525f49d45b69aa Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Wed, 9 Jul 2025 09:58:38 +0200 Subject: [PATCH 04/17] Generalize test_project This way the thest project is easily replacable --- .github/workflows/patch-test-proj.sh | 8 ++++---- .github/workflows/test.yml | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/patch-test-proj.sh b/.github/workflows/patch-test-proj.sh index a3c3bccf..d1e945b5 100644 --- a/.github/workflows/patch-test-proj.sh +++ b/.github/workflows/patch-test-proj.sh @@ -3,8 +3,8 @@ FORK_REPO="$1" FORK_BRANCH="$2" -git clone --recurse https://github.com/jbeder/yaml-cpp.git -cd yaml-cpp +git clone --recurse https://github.com/jbeder/yaml-cpp.git test_project +cd test_project git checkout yaml-cpp-0.7.0 # Specify bazel version for bazelisk @@ -26,14 +26,14 @@ load( codechecker_test( - name = "codechecker_test_yaml-cpp", + name = "codechecker_test", targets = [ ":yaml-cpp", ], ) code_checker_test( - name = "code_checker_test_yaml-cpp", + name = "code_checker_test", targets = [ ":yaml-cpp", ], diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23be3173..d66b1f07 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,16 +47,16 @@ jobs: - name: Setup environment uses: ./.github/actions/env_setup - - name: Patching codechecker_bazel targets onto yaml-cpp + - name: Patching codechecker_bazel targets onto test_project run: | sh .github/workflows/patch-test-proj.sh ${{ github.repository }} ${{ github.ref }} - name: Run Monolithic Bazel CodeChecker run: | - cd yaml-cpp - bazel build :codechecker_test_yaml-cpp + cd test_project + bazel build :codechecker_test - name: Run Distributed Bazel CodeChecker run: | - cd yaml-cpp - bazel build :code_checker_test_yaml-cpp + cd test_project + bazel build :code_checker_test From 7778fcb3617e509b02461cf45bca7993c154f499 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Wed, 9 Jul 2025 13:53:12 +0200 Subject: [PATCH 05/17] Force installation of bazel in setup phase --- .github/actions/env_setup/action.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/env_setup/action.yml b/.github/actions/env_setup/action.yml index 3cba05a3..88966377 100644 --- a/.github/actions/env_setup/action.yml +++ b/.github/actions/env_setup/action.yml @@ -3,12 +3,15 @@ description: 'Sets up analyzers, CodeChecker and Bazel' runs: using: "composite" steps: - - name: Set bazel version to 6.5.0 - run: echo "6.5.0" > .bazelversion - shell: bash - - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.15.0 + + # Writing out bazel version forces bazelisk to install bazel here + - name: Set bazel version to 6.5.0 + run: | + echo "6.5.0" > .bazelversion + bazel version + shell: bash - name: Install python uses: actions/setup-python@v5 From 3d81b4868621a997a6a5920507d7b092f89fda8e Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Wed, 9 Jul 2025 13:54:04 +0200 Subject: [PATCH 06/17] Copy version to avoid duplicate entries --- .github/workflows/patch-test-proj.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/patch-test-proj.sh b/.github/workflows/patch-test-proj.sh index d1e945b5..7cd243cf 100644 --- a/.github/workflows/patch-test-proj.sh +++ b/.github/workflows/patch-test-proj.sh @@ -7,8 +7,8 @@ git clone --recurse https://github.com/jbeder/yaml-cpp.git test_project cd test_project git checkout yaml-cpp-0.7.0 -# Specify bazel version for bazelisk -echo "6.5.0" > .bazelversion +# This file must be in the root of the project to be analyzed for bazelisk to work +cp ../.bazelversion ./.bazelversion # Add codechecker to the project cat <> BUILD.bazel From 1898cefab9ea6d7079958bb640f4eb2c96deb8c1 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Wed, 9 Jul 2025 13:54:30 +0200 Subject: [PATCH 07/17] Improve comments, run with bazel test --- .github/workflows/test.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d66b1f07..5a6355bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,8 +36,8 @@ jobs: python3 test.py -vvv small_test: - # Test if code runs successfully against a small project - name: Small Project Test + # Test the bazel rules introduced by repository on an independent open-source project. + name: Test On Small Project runs-on: ubuntu-24.04 steps: @@ -51,12 +51,14 @@ jobs: run: | sh .github/workflows/patch-test-proj.sh ${{ github.repository }} ${{ github.ref }} + # Running bazel with test will signal failure because CodeChecker found problems - name: Run Monolithic Bazel CodeChecker run: | cd test_project - bazel build :codechecker_test + bazel test :codechecker_test || [ $? -eq 3 ] && exit 0 || exit $? - - name: Run Distributed Bazel CodeChecker + # Running bazel with test will signal failure because CodeChecker found problems + - name: Run Per File Bazel CodeChecker run: | cd test_project - bazel build :code_checker_test + bazel test :code_checker_test || [ $? -eq 3 ] && exit 0 || exit $? From 2561c614e5971f0ad6c81e923ca0efd3a5d59050 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 21 Jul 2025 13:23:38 +0200 Subject: [PATCH 08/17] Refactor: Rename job for clarity --- .github/workflows/{patch-test-proj.sh => patch-yaml-cpp.sh} | 0 .github/workflows/test.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{patch-test-proj.sh => patch-yaml-cpp.sh} (100%) diff --git a/.github/workflows/patch-test-proj.sh b/.github/workflows/patch-yaml-cpp.sh similarity index 100% rename from .github/workflows/patch-test-proj.sh rename to .github/workflows/patch-yaml-cpp.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a6355bd..6f5a06c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,9 +35,9 @@ jobs: cd test python3 test.py -vvv - small_test: + yaml_cpp_test: # Test the bazel rules introduced by repository on an independent open-source project. - name: Test On Small Project + name: "Test On Small Project: yaml-cpp" runs-on: ubuntu-24.04 steps: From 0f35f99f781f617579a36eaeb2411366522f8550 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 21 Jul 2025 13:34:44 +0200 Subject: [PATCH 09/17] Fix file path --- .github/workflows/patch-yaml-cpp.sh | 4 ++-- .github/workflows/test.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/patch-yaml-cpp.sh b/.github/workflows/patch-yaml-cpp.sh index 7cd243cf..ba34205f 100644 --- a/.github/workflows/patch-yaml-cpp.sh +++ b/.github/workflows/patch-yaml-cpp.sh @@ -3,8 +3,8 @@ FORK_REPO="$1" FORK_BRANCH="$2" -git clone --recurse https://github.com/jbeder/yaml-cpp.git test_project -cd test_project +git clone --recurse https://github.com/jbeder/yaml-cpp.git yaml-cpp +cd yaml-cpp git checkout yaml-cpp-0.7.0 # This file must be in the root of the project to be analyzed for bazelisk to work diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f5a06c1..84750ae3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,16 +49,16 @@ jobs: - name: Patching codechecker_bazel targets onto test_project run: | - sh .github/workflows/patch-test-proj.sh ${{ github.repository }} ${{ github.ref }} + sh .github/workflows/patch-yaml-cpp.sh ${{ github.repository }} ${{ github.ref }} # Running bazel with test will signal failure because CodeChecker found problems - name: Run Monolithic Bazel CodeChecker run: | - cd test_project + cd yaml-cpp bazel test :codechecker_test || [ $? -eq 3 ] && exit 0 || exit $? # Running bazel with test will signal failure because CodeChecker found problems - name: Run Per File Bazel CodeChecker run: | - cd test_project + cd yaml-cpp bazel test :code_checker_test || [ $? -eq 3 ] && exit 0 || exit $? From d44588b471c4a5c1d440b1179758a6d788f69064 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 22 Jul 2025 20:14:21 +0200 Subject: [PATCH 10/17] Make project testing more extensible --- .../workflows/{ => patches}/patch-yaml-cpp.sh | 4 ++-- .github/workflows/test.yml | 22 +++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) rename .github/workflows/{ => patches}/patch-yaml-cpp.sh (93%) diff --git a/.github/workflows/patch-yaml-cpp.sh b/.github/workflows/patches/patch-yaml-cpp.sh similarity index 93% rename from .github/workflows/patch-yaml-cpp.sh rename to .github/workflows/patches/patch-yaml-cpp.sh index ba34205f..24d3ca37 100644 --- a/.github/workflows/patch-yaml-cpp.sh +++ b/.github/workflows/patches/patch-yaml-cpp.sh @@ -3,8 +3,8 @@ FORK_REPO="$1" FORK_BRANCH="$2" -git clone --recurse https://github.com/jbeder/yaml-cpp.git yaml-cpp -cd yaml-cpp +git clone --recurse https://github.com/jbeder/yaml-cpp.git test-proj +cd test-proj git checkout yaml-cpp-0.7.0 # This file must be in the root of the project to be analyzed for bazelisk to work diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84750ae3..2076eedb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,11 +35,19 @@ jobs: cd test python3 test.py -vvv - yaml_cpp_test: - # Test the bazel rules introduced by repository on an independent open-source project. - name: "Test On Small Project: yaml-cpp" + project_test_runner: + # Test the bazel rules introduced by repository on an independent open-source projects. runs-on: ubuntu-24.04 - + strategy: + fail-fast: false + max-parallel: 2 # limit number of concurrent jobs + matrix: + # Easily extensible project list + project: + - name: "yaml-cpp" + patch_script: ".github/workflows/patches/patch-yaml-cpp.sh" + + name: "Test On Project: ${{ matrix.project.name }}" # Dynamic job name in UI steps: - name: Checkout repository uses: actions/checkout@v4 @@ -49,16 +57,16 @@ jobs: - name: Patching codechecker_bazel targets onto test_project run: | - sh .github/workflows/patch-yaml-cpp.sh ${{ github.repository }} ${{ github.ref }} + sh ${{ matrix.project.patch_script }} ${{ github.repository }} ${{ github.ref }} # Running bazel with test will signal failure because CodeChecker found problems - name: Run Monolithic Bazel CodeChecker run: | - cd yaml-cpp + cd test-proj bazel test :codechecker_test || [ $? -eq 3 ] && exit 0 || exit $? # Running bazel with test will signal failure because CodeChecker found problems - name: Run Per File Bazel CodeChecker run: | - cd yaml-cpp + cd test-proj bazel test :code_checker_test || [ $? -eq 3 ] && exit 0 || exit $? From bef8e11412c91ef10a63598063471d6212a1717c Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 22 Jul 2025 20:42:14 +0200 Subject: [PATCH 11/17] Generate project matrix dinamically Unsure if its a good idea! --- .github/workflows/test.yml | 52 ++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2076eedb..df10e916 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,19 +35,61 @@ jobs: cd test python3 test.py -vvv + # Prepares matrix used to generate jobs in project_test_runner + # This job assumes that every project patch file is in the .github/workflows/patches directory + # and the name of these scripts follows this rule: patch-project_name.sh + # patches must clone their repository into folder: test-proj + prepare_project_matrix: + runs-on: ubuntu-24.04 + name: Collecting Projects + outputs: + project_configurations: ${{ steps.generate_matrix.outputs.matrix_json }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Generate dynamic project matrix + id: generate_matrix + run: | + PATCH_DIR="./.github/workflows/patches/" + TEMP_JSON_FILE=$(mktemp) + find "$PATCH_DIR" -type f -name "*.sh" -print0 | while IFS= read -r -d $'\0' PATCH_SCRIPT_PATH; do + # Extract project name from script path (e.g., "patch-yaml-cpp.sh" -> "yaml-cpp") + PROJECT_NAME=$(basename "$PATCH_SCRIPT_PATH" | sed -E 's/^patch-(.*)\.sh$/\1/') + + if [ -z $PROJECT_NAME ]; then + PROJECT_NAME="UNKNOWN" + fi + + jq -n -c \ + --arg name "$PROJECT_NAME" \ + --arg patch_script "$PATCH_SCRIPT_PATH" \ + '{ name: $name, patch_script: $patch_script }' >> "$TEMP_JSON_FILE" + + echo "Added $PROJECT_NAME to matrix." + done + + if [ -s "$TEMP_JSON_FILE" ]; then + FINAL_MATRIX_JSON="[$(paste -s -d ',' "$TEMP_JSON_FILE")]" + else + FINAL_MATRIX_JSON="[]" + fi + + echo "Generated matrix: $FINAL_MATRIX_JSON" + echo "matrix_json=$FINAL_MATRIX_JSON" >> "$GITHUB_OUTPUT" + shell: bash + project_test_runner: # Test the bazel rules introduced by repository on an independent open-source projects. runs-on: ubuntu-24.04 + needs: prepare_project_matrix strategy: fail-fast: false max-parallel: 2 # limit number of concurrent jobs matrix: - # Easily extensible project list - project: - - name: "yaml-cpp" - patch_script: ".github/workflows/patches/patch-yaml-cpp.sh" + project: ${{ fromJson(needs.prepare_project_matrix.outputs.project_configurations) }} - name: "Test On Project: ${{ matrix.project.name }}" # Dynamic job name in UI + name: "Test On Project: ${{ matrix.project.name }}" steps: - name: Checkout repository uses: actions/checkout@v4 From 36d888c9b895e83a112517256581ba049839604a Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Wed, 23 Jul 2025 08:33:05 +0200 Subject: [PATCH 12/17] Add zlib to list of projects --- .github/workflows/patches/patch-zlib.sh | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 .github/workflows/patches/patch-zlib.sh diff --git a/.github/workflows/patches/patch-zlib.sh b/.github/workflows/patches/patch-zlib.sh new file mode 100755 index 00000000..5ae1eeea --- /dev/null +++ b/.github/workflows/patches/patch-zlib.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +FORK_REPO="$1" +FORK_BRANCH="$2" + +git clone --recurse https://github.com/madler/zlib.git test-proj +cd test-proj +git checkout 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 + +# This file must be in the root of the project to be analyzed for bazelisk to work +cp ../.bazelversion ./.bazelversion + +# Add codechecker to the project +cat <> BUILD.bazel +#------------------------------------------------------- + +# codechecker rules +load( + "@bazel_codechecker//src:codechecker.bzl", + "codechecker_test", +) +load( + "@bazel_codechecker//src:code_checker.bzl", + "code_checker_test", +) + + +codechecker_test( + name = "codechecker_test", + targets = [ + ":z", + ], +) + +code_checker_test( + name = "code_checker_test", + targets = [ + ":z", + ], +) + +#------------------------------------------------------- +EOF + +cat <> WORKSPACE +#---------------------------------------------------- + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +git_repository( + name = "bazel_codechecker", + remote = "https://github.com/${FORK_REPO}", + branch = "${FORK_BRANCH}", +) + +load( + "@bazel_codechecker//src:tools.bzl", + "register_default_codechecker", + "register_default_python_toolchain", +) + +register_default_python_toolchain() + +register_default_codechecker() + +#---------------------------------------------------- +EOF From 1c2457f11b492fefbf8d232e79ea20782fe9b800 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 28 Jul 2025 10:31:22 +0200 Subject: [PATCH 13/17] Add local local running for foss projects --- .github/workflows/{test.yml => ci.yml} | 25 +++--- test/foss/templates/.bazelversion | 1 + test/foss/templates/WORKSPACE.template | 20 +++++ .../foss/yaml-cpp/init.sh | 31 +------- .../patch-zlib.sh => test/foss/zlib/init.sh | 31 +------- test/foss_test.sh | 76 +++++++++++++++++++ 6 files changed, 114 insertions(+), 70 deletions(-) rename .github/workflows/{test.yml => ci.yml} (79%) create mode 100644 test/foss/templates/.bazelversion create mode 100644 test/foss/templates/WORKSPACE.template rename .github/workflows/patches/patch-yaml-cpp.sh => test/foss/yaml-cpp/init.sh (55%) mode change 100644 => 100755 rename .github/workflows/patches/patch-zlib.sh => test/foss/zlib/init.sh (56%) create mode 100755 test/foss_test.sh diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 79% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index df10e916..a8038b91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -51,20 +51,16 @@ jobs: - name: Generate dynamic project matrix id: generate_matrix run: | - PATCH_DIR="./.github/workflows/patches/" + PATCH_DIR="./test/foss/" TEMP_JSON_FILE=$(mktemp) - find "$PATCH_DIR" -type f -name "*.sh" -print0 | while IFS= read -r -d $'\0' PATCH_SCRIPT_PATH; do - # Extract project name from script path (e.g., "patch-yaml-cpp.sh" -> "yaml-cpp") - PROJECT_NAME=$(basename "$PATCH_SCRIPT_PATH" | sed -E 's/^patch-(.*)\.sh$/\1/') - - if [ -z $PROJECT_NAME ]; then - PROJECT_NAME="UNKNOWN" - fi + find "$PATCH_DIR" -maxdepth 1 -mindepth 1 -type d ! -name "templates" -print0 | while IFS= read -r -d $'\0' PROJECT_FOLDER; do + # Extract project name from folder name + PROJECT_NAME=$(basename "$PROJECT_FOLDER") jq -n -c \ --arg name "$PROJECT_NAME" \ - --arg patch_script "$PATCH_SCRIPT_PATH" \ - '{ name: $name, patch_script: $patch_script }' >> "$TEMP_JSON_FILE" + --arg folder "$PROJECT_FOLDER" \ + '{ name: $name, folder: $folder }' >> "$TEMP_JSON_FILE" echo "Added $PROJECT_NAME to matrix." done @@ -97,18 +93,19 @@ jobs: - name: Setup environment uses: ./.github/actions/env_setup - - name: Patching codechecker_bazel targets onto test_project + - name: Initializing test run: | - sh ${{ matrix.project.patch_script }} ${{ github.repository }} ${{ github.ref }} + cd ${{ matrix.project.folder }} + sh ./init.sh # Running bazel with test will signal failure because CodeChecker found problems - name: Run Monolithic Bazel CodeChecker run: | - cd test-proj + cd ${{ matrix.project.folder }}/test-proj bazel test :codechecker_test || [ $? -eq 3 ] && exit 0 || exit $? # Running bazel with test will signal failure because CodeChecker found problems - name: Run Per File Bazel CodeChecker run: | - cd test-proj + cd ${{ matrix.project.folder }}/test-proj bazel test :code_checker_test || [ $? -eq 3 ] && exit 0 || exit $? diff --git a/test/foss/templates/.bazelversion b/test/foss/templates/.bazelversion new file mode 100644 index 00000000..4be2c727 --- /dev/null +++ b/test/foss/templates/.bazelversion @@ -0,0 +1 @@ +6.5.0 \ No newline at end of file diff --git a/test/foss/templates/WORKSPACE.template b/test/foss/templates/WORKSPACE.template new file mode 100644 index 00000000..ffda78d4 --- /dev/null +++ b/test/foss/templates/WORKSPACE.template @@ -0,0 +1,20 @@ +#---------------------------------------------------- + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +local_repository( + name = "bazel_codechecker", + path = "../../../../", +) + +load( + "@bazel_codechecker//src:tools.bzl", + "register_default_codechecker", + "register_default_python_toolchain", +) + +register_default_python_toolchain() + +register_default_codechecker() + +#---------------------------------------------------- \ No newline at end of file diff --git a/.github/workflows/patches/patch-yaml-cpp.sh b/test/foss/yaml-cpp/init.sh old mode 100644 new mode 100755 similarity index 55% rename from .github/workflows/patches/patch-yaml-cpp.sh rename to test/foss/yaml-cpp/init.sh index 24d3ca37..a3ea26aa --- a/.github/workflows/patches/patch-yaml-cpp.sh +++ b/test/foss/yaml-cpp/init.sh @@ -1,14 +1,10 @@ #!/bin/bash - -FORK_REPO="$1" -FORK_BRANCH="$2" - git clone --recurse https://github.com/jbeder/yaml-cpp.git test-proj cd test-proj git checkout yaml-cpp-0.7.0 # This file must be in the root of the project to be analyzed for bazelisk to work -cp ../.bazelversion ./.bazelversion +cp ../../templates/.bazelversion ./.bazelversion # Add codechecker to the project cat <> BUILD.bazel @@ -42,26 +38,5 @@ code_checker_test( #------------------------------------------------------- EOF -cat <> WORKSPACE -#---------------------------------------------------- - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "bazel_codechecker", - remote = "https://github.com/${FORK_REPO}", - branch = "${FORK_BRANCH}", -) - -load( - "@bazel_codechecker//src:tools.bzl", - "register_default_codechecker", - "register_default_python_toolchain", -) - -register_default_python_toolchain() - -register_default_codechecker() - -#---------------------------------------------------- -EOF \ No newline at end of file +# Add codechecker_bazel repo to WORKSPACE +cat ../../templates/WORKSPACE.template >> WORKSPACE \ No newline at end of file diff --git a/.github/workflows/patches/patch-zlib.sh b/test/foss/zlib/init.sh similarity index 56% rename from .github/workflows/patches/patch-zlib.sh rename to test/foss/zlib/init.sh index 5ae1eeea..93958517 100755 --- a/.github/workflows/patches/patch-zlib.sh +++ b/test/foss/zlib/init.sh @@ -1,14 +1,10 @@ #!/bin/bash - -FORK_REPO="$1" -FORK_BRANCH="$2" - git clone --recurse https://github.com/madler/zlib.git test-proj cd test-proj git checkout 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 # This file must be in the root of the project to be analyzed for bazelisk to work -cp ../.bazelversion ./.bazelversion +cp ../../templates/.bazelversion ./.bazelversion # Add codechecker to the project cat <> BUILD.bazel @@ -42,26 +38,5 @@ code_checker_test( #------------------------------------------------------- EOF -cat <> WORKSPACE -#---------------------------------------------------- - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "bazel_codechecker", - remote = "https://github.com/${FORK_REPO}", - branch = "${FORK_BRANCH}", -) - -load( - "@bazel_codechecker//src:tools.bzl", - "register_default_codechecker", - "register_default_python_toolchain", -) - -register_default_python_toolchain() - -register_default_codechecker() - -#---------------------------------------------------- -EOF +# Add codechecker_bazel repo to WORKSPACE +cat ../../templates/WORKSPACE.template >> WORKSPACE diff --git a/test/foss_test.sh b/test/foss_test.sh new file mode 100755 index 00000000..4528662b --- /dev/null +++ b/test/foss_test.sh @@ -0,0 +1,76 @@ +#!/bin/bash +FOSS_BASE_DIR="./foss" +if [ ! -d "$FOSS_BASE_DIR" ]; then + echo "Error: The directory '$FOSS_BASE_DIR' does not exist." + exit 1 +fi + +if [ "$1" == "clean" ]; then + find "$FOSS_BASE_DIR" -maxdepth 2 -mindepth 2 -type d -name "test-proj" ! -path "*/templates/*" -print -exec rm -rf {} + + exit $? +fi + +echo "Starting Bazel build process for projects in '$FOSS_BASE_DIR'..." +echo "-----------------------------------------------------------------" +find "$FOSS_BASE_DIR" -maxdepth 1 -mindepth 1 -type d | while read -r project_dir; do + if ! command -v CodeChecker &> /dev/null; then + echo "CodeChecker isn't available! Terminating..." + echo "-----------------------------------------------------------------" + exit 1 + fi + project_name=$(basename "$project_dir") + + if [ "$project_name" == "templates" ]; then + echo "Skipping 'templates' directory: $project_dir" + continue + fi + + echo "" + echo "Processing project: $project_name ($project_dir)" + echo "-----------------------------------------------------------------" + + pushd "$project_dir" > /dev/null || { echo "Error: Could not change to $project_dir. Skipping."; continue; } + + if [ ! -d "test-proj" ]; then + echo " Running ./init.sh..." + if [ -f "./init.sh" ]; then + ./init.sh > /dev/null + if [ $? -ne 0 ]; then + echo " Warning: ./init.sh failed for $project_name. Skipping."; popd > /dev/null; continue; + fi + else + echo " Warning: ./init.sh not found in $project_name. Skipping."; popd > /dev/null; continue; + fi + else + echo "test-proj already exists. Skipping init.sh for $project_name" + fi + + if [ -d "test-proj" ]; then + pushd "test-proj" > /dev/null || { echo "Error: Could not change to test-proj in $project_name. Skipping."; popd > /dev/null; continue; } + + echo " Running bazel build :codechecker_test..." + bazel build :codechecker_test + if [ $? -ne 0 ]; then + echo " Error: 'bazel build :codechecker_test' failed for $project_name. Check logs above." + fi + + echo " Running bazel build :code_checker_test..." + bazel build :code_checker_test + if [ $? -ne 0 ]; then + echo " Error: 'bazel build :code_checker_test' failed for $project_name. Check logs above." + fi + + popd > /dev/null + else + echo " Error: 'test-proj' directory not found in $project_name. Skipping Bazel builds." + fi + + popd > /dev/null + + echo "-----------------------------------------------------------------" + echo "Finished processing project: $project_name" +done + +echo "" +echo "-----------------------------------------------------------------" +echo "Bazel build process completed." From c6dbca98e39a04ba16327c508ecb459b2ff0492a Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Fri, 1 Aug 2025 10:24:30 +0200 Subject: [PATCH 14/17] Rewrite to python --- test/foss_test.py | 165 ++++++++++++++++++++++++++++++++++++++++++++++ test/foss_test.sh | 76 --------------------- 2 files changed, 165 insertions(+), 76 deletions(-) create mode 100644 test/foss_test.py delete mode 100755 test/foss_test.sh diff --git a/test/foss_test.py b/test/foss_test.py new file mode 100644 index 00000000..8b34565d --- /dev/null +++ b/test/foss_test.py @@ -0,0 +1,165 @@ +import os +import sys +import shutil +import subprocess + +FOSS_BASE_DIR = "./foss" + +def main(): + """ + Finds all open source project and calls the tests on each of them + """ + if not os.path.isdir(FOSS_BASE_DIR): + print(f"Error: The directory '{FOSS_BASE_DIR}' does not exist.") + sys.exit(1) + + if len(sys.argv) > 1 and sys.argv[1] == "clean": + clean_projects() + sys.exit(0) + + print(f"Starting in '{FOSS_BASE_DIR}' ...") + print("-----------------------------------------------------------------") + + if shutil.which("CodeChecker") is None: + print("CodeChecker not found! Terminating...") + print("----------------------------------------------------------\ + -------") + sys.exit(1) + + try: + for project_name in os.listdir(FOSS_BASE_DIR): + project_dir = os.path.join(FOSS_BASE_DIR, project_name) + + if not os.path.isdir(project_dir): + continue + + if project_name == "templates": + continue + + process_project(project_dir, project_name) + + except OSError as e: + print(f"An error occurred while processing directories: {e}") + sys.exit(1) + + print("\n-----------------------------------------------------------------") + print("Done.") + +def clean_projects(): + """ + Finds and removes 'test-proj' directories and log files + """ + print("Starting cleanup process...") + for root, dirs, files in os.walk(FOSS_BASE_DIR): + depth = root.count(os.sep) - FOSS_BASE_DIR.count(os.sep) + if depth == 1 and "test-proj" in dirs: + test_proj_path = os.path.join(root, "test-proj") + print(f"Removing directory: {test_proj_path}") + shutil.rmtree(test_proj_path) + if "codechecker.log" in files: + log_pth = os.path.join(root, "codechecker.log") + print(log_pth) + os.remove(log_pth) + if "code_checker.log" in files: + log_pth = os.path.join(root, "code_checker.log") + print(log_pth) + os.remove(log_pth) + +def process_project(project_dir, project_name): + """ + Handles the initializing and testing process for a single project. + """ + print(f"\nProcessing project: {project_name} ({project_dir})") + print("-----------------------------------------------------------------") + + test_proj_dir = os.path.join(project_dir, "test-proj") + init_script_path = os.path.join(project_dir, "init.sh") + + if not os.path.isdir(test_proj_dir): + print(" Running ./init.sh...") + + if not os.path.isfile(init_script_path): + print(f" Warning: ./init.sh not found in {project_name}. \ + Skipping.") + print("---------------------------------------------------------\ + --------") + return + + if not os.access(init_script_path, os.X_OK): + print(f" Warning: ./init.sh found in {project_name} \ + but it is not executable.") + print(" Please run 'chmod +x init.sh' inside the project \ + directory and try again.") + print("-------------------------------------------------------\ + ----------") + return + + try: + subprocess.run( + ["./init.sh"], + cwd=project_dir, + check=True, + capture_output=True, + text=True + ) + except subprocess.CalledProcessError: + print(f" Warning: ./init.sh failed for {project_name}. Skipping.") + print("------------------------------------------------------\ + -----------") + return + else: + print(f"test-proj already exists. Skipping init.sh for {project_name}") + + if os.path.isdir(test_proj_dir): + print(" Running bazel build :codechecker_test...") + try: + tee_proc = subprocess.Popen(["tee", "../codechecker.log"], + stdin=subprocess.PIPE, cwd=test_proj_dir, text=True) + + subprocess.run( + ["bazel", "build", ":codechecker_test"], + cwd=test_proj_dir, + stdout=tee_proc.stdin, + stderr=tee_proc.stdin, + text=True, + check=True + ) + + tee_proc.stdin.close() + tee_proc.wait() + + except subprocess.CalledProcessError: + print(f" Error: 'bazel build :codechecker_test' failed for \ + {project_name}. Check logs above or in \ + {project_dir}/codechecker.log.") + + print(" Running bazel build :code_checker_test...") + try: + tee_proc = subprocess.Popen(["tee", "../code_checker.log"], + stdin=subprocess.PIPE, cwd=test_proj_dir, text=True) + + subprocess.run( + ["bazel", "build", ":code_checker_test"], + cwd=test_proj_dir, + stdout=tee_proc.stdin, + stderr=tee_proc.stdin, + text=True, + check=True + ) + + tee_proc.stdin.close() + tee_proc.wait() + except subprocess.CalledProcessError: + print(f" Error: 'bazel build :code_checker_test' failed for \ + {project_name}. Check logs above or in \ + {project_dir}/code_checker.log.") + else: + print(f" Error: 'test-proj' directory not found in {project_name}. \ + Skipping Bazel builds.") + + print("-----------------------------------------------------------------") + print(f"Finished processing project: {project_name}") + + +if __name__ == "__main__": + main() diff --git a/test/foss_test.sh b/test/foss_test.sh deleted file mode 100755 index 4528662b..00000000 --- a/test/foss_test.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -FOSS_BASE_DIR="./foss" -if [ ! -d "$FOSS_BASE_DIR" ]; then - echo "Error: The directory '$FOSS_BASE_DIR' does not exist." - exit 1 -fi - -if [ "$1" == "clean" ]; then - find "$FOSS_BASE_DIR" -maxdepth 2 -mindepth 2 -type d -name "test-proj" ! -path "*/templates/*" -print -exec rm -rf {} + - exit $? -fi - -echo "Starting Bazel build process for projects in '$FOSS_BASE_DIR'..." -echo "-----------------------------------------------------------------" -find "$FOSS_BASE_DIR" -maxdepth 1 -mindepth 1 -type d | while read -r project_dir; do - if ! command -v CodeChecker &> /dev/null; then - echo "CodeChecker isn't available! Terminating..." - echo "-----------------------------------------------------------------" - exit 1 - fi - project_name=$(basename "$project_dir") - - if [ "$project_name" == "templates" ]; then - echo "Skipping 'templates' directory: $project_dir" - continue - fi - - echo "" - echo "Processing project: $project_name ($project_dir)" - echo "-----------------------------------------------------------------" - - pushd "$project_dir" > /dev/null || { echo "Error: Could not change to $project_dir. Skipping."; continue; } - - if [ ! -d "test-proj" ]; then - echo " Running ./init.sh..." - if [ -f "./init.sh" ]; then - ./init.sh > /dev/null - if [ $? -ne 0 ]; then - echo " Warning: ./init.sh failed for $project_name. Skipping."; popd > /dev/null; continue; - fi - else - echo " Warning: ./init.sh not found in $project_name. Skipping."; popd > /dev/null; continue; - fi - else - echo "test-proj already exists. Skipping init.sh for $project_name" - fi - - if [ -d "test-proj" ]; then - pushd "test-proj" > /dev/null || { echo "Error: Could not change to test-proj in $project_name. Skipping."; popd > /dev/null; continue; } - - echo " Running bazel build :codechecker_test..." - bazel build :codechecker_test - if [ $? -ne 0 ]; then - echo " Error: 'bazel build :codechecker_test' failed for $project_name. Check logs above." - fi - - echo " Running bazel build :code_checker_test..." - bazel build :code_checker_test - if [ $? -ne 0 ]; then - echo " Error: 'bazel build :code_checker_test' failed for $project_name. Check logs above." - fi - - popd > /dev/null - else - echo " Error: 'test-proj' directory not found in $project_name. Skipping Bazel builds." - fi - - popd > /dev/null - - echo "-----------------------------------------------------------------" - echo "Finished processing project: $project_name" -done - -echo "" -echo "-----------------------------------------------------------------" -echo "Bazel build process completed." From 78fb7673633b3d3fc9221fb93d2953aa01812449 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 4 Aug 2025 07:54:48 +0200 Subject: [PATCH 15/17] Add documentation on how to add new projects --- test/foss/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/foss/README.md diff --git a/test/foss/README.md b/test/foss/README.md new file mode 100644 index 00000000..edb068bb --- /dev/null +++ b/test/foss/README.md @@ -0,0 +1,10 @@ +# How to add a new project: + +- Create a folder with the name of the project. +- place an init.sh script in the folder, this script should: + - Clone the test project into a folder named `test-proj`. + - To ensure the project doesn't change over time, check out a specific tag or commit instead of a branch! + - Copy the .bazelversion file from the templates directory. + - Append the WORKSPACE.template file to the WORKSPACE file of the project. + - Append the codechecker rules to the BUILD file of the project. + - There can be only two targets, codechecker_test and code_checker_test \ No newline at end of file From 6b2f1047272f0162bac99f86e27491caac5c7f09 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Thu, 7 Aug 2025 14:56:39 +0200 Subject: [PATCH 16/17] Apply update-alternatives patch here too --- .github/actions/env_setup/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/actions/env_setup/action.yml b/.github/actions/env_setup/action.yml index 88966377..6c118ffe 100644 --- a/.github/actions/env_setup/action.yml +++ b/.github/actions/env_setup/action.yml @@ -25,6 +25,17 @@ runs: clang \ clang-tools \ clang-tidy + # The default naming of the clang-extdef-mapping, needed for CTU, is + # installed by clang-tools also contains the major version + # (e.g. clang-extdef-mapping-18), but the bazel rules reference it + # without the version number. To this end, we use update-alternatives + # to rename the binary to omit it. + sudo update-alternatives --install \ + /usr/bin/clang-extdef-mapping \ + clang-extdef-mapping \ + /usr/bin/clang-extdef-mapping-$(clang --version | head -n 1 | + sed -E 's/.*version ([0-9]+)\..*/\1/') \ + 100 shell: bash - name: Install CodeChecker From e9899de41aa4ac868d28fc374f287edea3b8f3c2 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 18 Aug 2025 11:38:15 +0200 Subject: [PATCH 17/17] Add license --- test/foss/yaml-cpp/init.sh | 17 ++++++++++++++++- test/foss/zlib/init.sh | 15 +++++++++++++++ test/foss_test.py | 14 ++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index a3ea26aa..f86d5160 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -1,4 +1,19 @@ #!/bin/bash + +# Copyright 2023 Ericsson AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + git clone --recurse https://github.com/jbeder/yaml-cpp.git test-proj cd test-proj git checkout yaml-cpp-0.7.0 @@ -39,4 +54,4 @@ code_checker_test( EOF # Add codechecker_bazel repo to WORKSPACE -cat ../../templates/WORKSPACE.template >> WORKSPACE \ No newline at end of file +cat ../../templates/WORKSPACE.template >> WORKSPACE diff --git a/test/foss/zlib/init.sh b/test/foss/zlib/init.sh index 93958517..da02fc7e 100755 --- a/test/foss/zlib/init.sh +++ b/test/foss/zlib/init.sh @@ -1,4 +1,19 @@ #!/bin/bash + +# Copyright 2023 Ericsson AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + git clone --recurse https://github.com/madler/zlib.git test-proj cd test-proj git checkout 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 diff --git a/test/foss_test.py b/test/foss_test.py index 8b34565d..67facffa 100644 --- a/test/foss_test.py +++ b/test/foss_test.py @@ -1,3 +1,17 @@ +# Copyright 2023 Ericsson AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import sys import shutil