From 84a248ce6a71e9328077ec5f08fec68d91d30b8a Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 10 Nov 2022 21:37:17 +0100 Subject: [PATCH 01/30] Adding clang format. --- .clang-format | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000000..2f68c131c6e --- /dev/null +++ b/.clang-format @@ -0,0 +1,11 @@ +--- +BasedOnStyle: Google +ColumnLimit: '100' +IndentPPDirectives: None +IndentWidth: '4' +MaxEmptyLinesToKeep: '1' +SpacesInParentheses: 'false' +TabWidth: '4' +UseTab: Never + +... From 0e05fca6899ec8d784e8ff9d415bcccfe334d07b Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Fri, 11 Nov 2022 13:26:31 +0100 Subject: [PATCH 02/30] Update .clang-format Co-authored-by: Dmitry Kalinkin --- .clang-format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index 2f68c131c6e..c9629beb35c 100644 --- a/.clang-format +++ b/.clang-format @@ -2,10 +2,10 @@ BasedOnStyle: Google ColumnLimit: '100' IndentPPDirectives: None -IndentWidth: '4' +IndentWidth: '3' MaxEmptyLinesToKeep: '1' SpacesInParentheses: 'false' -TabWidth: '4' +TabWidth: '3' UseTab: Never ... From a5c9a67ce9fb26a1f25bc73a13a40edba8d1206d Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Fri, 11 Nov 2022 18:06:46 +0100 Subject: [PATCH 03/30] Update .clang-format Co-authored-by: Dmitri Smirnov --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index c9629beb35c..8ef729d1540 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,6 @@ --- BasedOnStyle: Google -ColumnLimit: '100' +ColumnLimit: '120' IndentPPDirectives: None IndentWidth: '3' MaxEmptyLinesToKeep: '1' From baab1a23c91a5af680937c0659c1da81b8befa24 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 11 Nov 2022 12:17:50 -0500 Subject: [PATCH 04/30] Don't trigger CI for changes in .clang-format --- .github/workflows/build-pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index 0b0c97a9ae8..482f18cd985 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -4,6 +4,7 @@ on: pull_request: paths-ignore: - '.github/**' + - '.clang-format' - 'docs/**' - '!.github/workflows/**' From 4be9085d07501cf99b47e402405274d157f4b92f Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 17 Nov 2022 18:54:55 +0100 Subject: [PATCH 05/30] Test of workflow added. --- .github/workflows/check-format.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/check-format.yml diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml new file mode 100644 index 00000000000..ba402b0aaef --- /dev/null +++ b/.github/workflows/check-format.yml @@ -0,0 +1,13 @@ +name: clang-format Check +on: [push, pull_request] +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.9.0 + with: + clang-format-version: '13' + check-path: '.' From b6c965f4fd6b0206c3d70605d8874c139a566377 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 17 Nov 2022 20:44:05 +0100 Subject: [PATCH 06/30] Experimental change of formatter. --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index ba402b0aaef..141fb1cbe33 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.9.0 + uses: DanielWielanek/clang-format-action@main with: clang-format-version: '13' check-path: '.' From 54d1f826855844483ccba8d54b27cdcf6ee9d172 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 17 Nov 2022 20:49:10 +0100 Subject: [PATCH 07/30] Removed old commment. --- StRoot/StHbtMaker/StHbtMaker.h | 1 - 1 file changed, 1 deletion(-) diff --git a/StRoot/StHbtMaker/StHbtMaker.h b/StRoot/StHbtMaker/StHbtMaker.h index b56818da713..bf177ec1aec 100644 --- a/StRoot/StHbtMaker/StHbtMaker.h +++ b/StRoot/StHbtMaker/StHbtMaker.h @@ -103,6 +103,5 @@ inline StHbtManager* StHbtMaker::HbtManager(){return mHbtManager;} inline int StHbtMaker::Debug() const {return mDebug;} inline void StHbtMaker::SetDebug(int d){mDebug=d;} -//this is test comment for testing cvs commit #endif From d69697a8c288bb44708b2b77deef8a9585519a90 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 17 Nov 2022 14:54:08 -0500 Subject: [PATCH 08/30] rm .github/workflows/build-pull-request.yml --- .github/workflows/build-pull-request.yml | 137 ----------------------- 1 file changed, 137 deletions(-) delete mode 100644 .github/workflows/build-pull-request.yml diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml deleted file mode 100644 index 482f18cd985..00000000000 --- a/.github/workflows/build-pull-request.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: Build Pull Request - -on: - pull_request: - paths-ignore: - - '.github/**' - - '.clang-format' - - 'docs/**' - - '!.github/workflows/**' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - starenv: [root5, root6] - compiler: [gcc485, gcc11] - env: - STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }} - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 - - - name: Build with Docker - uses: docker/build-push-action@v3 - with: - build-args: | - starenv=${{ matrix.starenv }} - compiler=${{ matrix.compiler }} - tags: ghcr.io/star-bnl/star-sw-${{ env.STARENV }} - outputs: type=docker,dest=/tmp/star-sw-${{ env.STARENV }}.tar - - - name: Save built image for test jobs - uses: actions/upload-artifact@v3 - with: - name: star-sw-${{ env.STARENV }} - path: /tmp/star-sw-${{ env.STARENV }}.tar - - ROOT5_test: - runs-on: ubuntu-latest - needs: build - strategy: - fail-fast: false - matrix: - test_id: [10, 11, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 76, 77, 78, 90, 91, 92, 102, 103, 119, 120, 121, 122, 123] - compiler: [gcc485, gcc11] - env: - STARENV: root5-${{ matrix.compiler }} - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: star-sw-${{ env.STARENV }} - path: /tmp - - - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 - - run: | - TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py -c ${{ matrix.test_id }}) - # Workaround https://sft.its.cern.ch/jira/browse/ROOT-7660 in ROOT 5 by checking the output log - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ - sh -c "set -e; MALLOC_CHECK_=3 $TEST_CMD 2>&1 | tee log; grep 'Run completed' log" - - ROOT5_test_doEvents: - runs-on: ubuntu-latest - needs: build - strategy: - fail-fast: false - matrix: - test_id: [121, 122] - compiler: [gcc485, gcc11] - env: - STARENV: root5-${{ matrix.compiler }} - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: star-sw-${{ env.STARENV }} - path: /tmp - - - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 - - run: | - TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') - TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'" - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ - sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' IO:' log" - - ROOT5_test_find_vertex: - runs-on: ubuntu-latest - needs: build - strategy: - fail-fast: false - matrix: - test_id: [102, 121, 122] - compiler: [gcc485, gcc11] - env: - STARENV: root5-${{ matrix.compiler }} - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: star-sw-${{ env.STARENV }} - path: /tmp - - - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 - - run: | - TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') - TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'" - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ - sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' StIO:' log" - - ROOT6_test_ignore_fail: - runs-on: ubuntu-latest - needs: build - strategy: - fail-fast: false - matrix: - test_id: [50, 52, 54, 90, 91, 92, 119, 120] - env: - STARENV: root6-gcc485 - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: star-sw-${{ env.STARENV }} - path: /tmp - - - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 - - run: | - TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py -c ${{ matrix.test_id }}) - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ - sh -c "MALLOC_CHECK_=3 $TEST_CMD || echo 'Failed with an exit code: '\$?" From 741c1cbe0ad74857d55e48c05d2c4a86e5d6d6e1 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 17 Nov 2022 22:17:02 +0100 Subject: [PATCH 09/30] Update StHbtMaker.h --- StRoot/StHbtMaker/StHbtMaker.h | 1 - 1 file changed, 1 deletion(-) diff --git a/StRoot/StHbtMaker/StHbtMaker.h b/StRoot/StHbtMaker/StHbtMaker.h index bf177ec1aec..64ccaa31c29 100644 --- a/StRoot/StHbtMaker/StHbtMaker.h +++ b/StRoot/StHbtMaker/StHbtMaker.h @@ -103,5 +103,4 @@ inline StHbtManager* StHbtMaker::HbtManager(){return mHbtManager;} inline int StHbtMaker::Debug() const {return mDebug;} inline void StHbtMaker::SetDebug(int d){mDebug=d;} - #endif From 2126d58738a8c70655df2399fcf1aea73c235ea6 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 17 Nov 2022 23:40:52 +0100 Subject: [PATCH 10/30] Update check-format.yml --- .github/workflows/check-format.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 141fb1cbe33..5655007635a 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -11,3 +11,4 @@ jobs: with: clang-format-version: '13' check-path: '.' + upstream: https://github.com/star-bnl/star-sw.git From a84eec5b995fb6a6b705b0857a170dfe247a8701 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Tue, 22 Nov 2022 20:33:28 +0100 Subject: [PATCH 11/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 5655007635a..5998c7ea1f7 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -11,4 +11,4 @@ jobs: with: clang-format-version: '13' check-path: '.' - upstream: https://github.com/star-bnl/star-sw.git + upstream-path: https://github.com/star-bnl/star-sw.git From eee5b1a779819f37ba1e977649385178175b08f0 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 12:28:52 +0100 Subject: [PATCH 12/30] Update check-format.yml --- .github/workflows/check-format.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 5998c7ea1f7..5aff2399654 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -5,10 +5,13 @@ jobs: name: Formatting Check runs-on: ubuntu-latest steps: + - id: files + - uses: jitterbit/get-changed-files@v1 - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main with: clang-format-version: '13' check-path: '.' + files-list: ${{steps.files.outputs.al}} upstream-path: https://github.com/star-bnl/star-sw.git From a9f966b042b13807b793cb05d4e94e0bf42e5167 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 12:33:02 +0100 Subject: [PATCH 13/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 5aff2399654..a8ae43ff130 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -13,5 +13,5 @@ jobs: with: clang-format-version: '13' check-path: '.' - files-list: ${{steps.files.outputs.al}} + files-list: ${{steps.files.outputs.added_modified}} upstream-path: https://github.com/star-bnl/star-sw.git From 9ab8f0ec56e1803d67b40903f50442c63cf1b2ca Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 12:35:42 +0100 Subject: [PATCH 14/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index a8ae43ff130..5e471f76b25 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - id: files - - uses: jitterbit/get-changed-files@v1 + uses: jitterbit/get-changed-files@v1 - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main From 85ebfbeb18f76174e4002015d9ec9f18c91043e5 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 12:51:32 +0100 Subject: [PATCH 15/30] Update check-format.yml --- .github/workflows/check-format.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 5e471f76b25..70436eb6657 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -7,11 +7,12 @@ jobs: steps: - id: files uses: jitterbit/get-changed-files@v1 + run: echo "Today is ${{ steps.files.outputs.added_modified }}" - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main with: clang-format-version: '13' check-path: '.' - files-list: ${{steps.files.outputs.added_modified}} + files-list: ${{ steps.files.outputs.added_modified }} upstream-path: https://github.com/star-bnl/star-sw.git From 111fdadc6010f3f7e5b5e7062ce68893853e994a Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 12:57:32 +0100 Subject: [PATCH 16/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 70436eb6657..dfb74bf4257 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -7,7 +7,7 @@ jobs: steps: - id: files uses: jitterbit/get-changed-files@v1 - run: echo "Today is ${{ steps.files.outputs.added_modified }}" + - run: echo "Today is ${{ steps.files.outputs.added_modified }}" - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main From 580992e249b00ce836516fde3b65643e61493b1e Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:10:03 +0100 Subject: [PATCH 17/30] Update check-format.yml --- .github/workflows/check-format.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index dfb74bf4257..3796da9a017 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -5,9 +5,14 @@ jobs: name: Formatting Check runs-on: ubuntu-latest steps: - - id: files - uses: jitterbit/get-changed-files@v1 - - run: echo "Today is ${{ steps.files.outputs.added_modified }}" + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Find common ancestor + env: + BASE_BRANCH: ${{ github.base_ref }} + run: git merge-base --fork-point origin/$BASE_BRANCH - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main From 5be6f4cc0d0b43017904600ea8f4becfe0fa9c80 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:11:31 +0100 Subject: [PATCH 18/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 3796da9a017..060ad50fa7b 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -12,7 +12,7 @@ jobs: - name: Find common ancestor env: BASE_BRANCH: ${{ github.base_ref }} - run: git merge-base --fork-point origin/$BASE_BRANCH + run: git merge-base --fork-point origin/main - uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main From c14645da8628d99c52980132a120fc79a63ea4b9 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:18:40 +0100 Subject: [PATCH 19/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 060ad50fa7b..a5bceda3128 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -14,6 +14,8 @@ jobs: BASE_BRANCH: ${{ github.base_ref }} run: git merge-base --fork-point origin/main - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main with: From cbdd239fe396e16061f5c039c339ca0442c68e16 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:25:47 +0100 Subject: [PATCH 20/30] Update check-format.yml --- .github/workflows/check-format.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index a5bceda3128..1c361a662b5 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -10,9 +10,7 @@ jobs: with: fetch-depth: 0 - name: Find common ancestor - env: - BASE_BRANCH: ${{ github.base_ref }} - run: git merge-base --fork-point origin/main + run: git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} - uses: actions/checkout@v3 with: fetch-depth: 0 From 66e0987035cae02ef05e40624fd8e4941bd95374 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:50:59 +0100 Subject: [PATCH 21/30] Update check-format.yml --- .github/workflows/check-format.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 1c361a662b5..84a7bad007f 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -5,15 +5,21 @@ jobs: name: Formatting Check runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 + - name: test_Files + uses: actions/checkout@v3 with: - fetch-depth: 0 - - name: Find common ancestor - run: git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + + # Example 1 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + + - name: List all changed files + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo "$file was changed" + done - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main with: From 9bcbfa944ce7f85f8810d917518349db400592c1 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:56:03 +0100 Subject: [PATCH 22/30] Update check-format.yml --- .github/workflows/check-format.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 84a7bad007f..238952c1ce7 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -20,6 +20,7 @@ jobs: for file in ${{ steps.changed-files.outputs.all_changed_files }}; do echo "$file was changed" done + - name: Run clang-format style check for C/C++/Protobuf programs. uses: DanielWielanek/clang-format-action@main with: From ff87fa12c94370fe931ef616fab9345d9abdaa92 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 24 Nov 2022 13:59:02 +0100 Subject: [PATCH 23/30] Update check-format.yml --- .github/workflows/check-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 238952c1ce7..5c24fd18dcd 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -18,7 +18,7 @@ jobs: - name: List all changed files run: | for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "$file was changed" + echo "$file was changed " done - name: Run clang-format style check for C/C++/Protobuf programs. From ac70c1c6880888a950bd233955cd2b0088467c9f Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Wed, 30 Nov 2022 23:07:55 +0100 Subject: [PATCH 24/30] Update check-format.yml --- .github/workflows/check-format.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 5c24fd18dcd..a4d9247ce30 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -9,22 +9,10 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - - # Example 1 - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v34 - - - name: List all changed files - run: | - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "$file was changed " - done - - - name: Run clang-format style check for C/C++/Protobuf programs. + - name: Run clang-format style check for C/C++ files. uses: DanielWielanek/clang-format-action@main with: clang-format-version: '13' check-path: '.' - files-list: ${{ steps.files.outputs.added_modified }} + upstream-branch: upstream/main upstream-path: https://github.com/star-bnl/star-sw.git From 27f7e6ac7ec3976ed31ac990ec8a734891c4d11a Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Wed, 30 Nov 2022 23:21:38 +0100 Subject: [PATCH 25/30] Clang format test. --- StRoot/StHbtMaker/StHbtMaker.h | 56 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/StRoot/StHbtMaker/StHbtMaker.h b/StRoot/StHbtMaker/StHbtMaker.h index 64ccaa31c29..51756afbbca 100644 --- a/StRoot/StHbtMaker/StHbtMaker.h +++ b/StRoot/StHbtMaker/StHbtMaker.h @@ -61,46 +61,48 @@ typedef int Int_t; #endif #include "StHbtMaker/Infrastructure/StHbtManager.h" -//class StHbtManager; - +// class StHbtManager; class StHbtMaker -#ifdef __ROOT__ -: public StMaker +#ifdef __ROOT__ + : public StMaker #endif { - - private: - StHbtManager* mHbtManager;//! tells cint to skip it - int mDebug; - public: - StHbtMaker(const char* name = "StHbt", const char* title = "StHbtTit"); - virtual ~StHbtMaker(); - virtual void Clear(const char* opt=""); - virtual Int_t Init();//! - virtual Int_t Make(); - virtual Int_t Finish();//! + private: + StHbtManager* mHbtManager; //! tells cint to skip it + + int mDebug; + + public: + StHbtMaker(const char* name = "StHbt", const char* title = "StHbtTit"); + virtual ~StHbtMaker(); + virtual void Clear(const char* opt = ""); + virtual Int_t Init(); //! + virtual Int_t Make(); + virtual Int_t Finish(); //! - int Debug() const; - void SetDebug(int); + int Debug() const; + void SetDebug(int); #ifdef __ROOT__ - StMaker* currentChain; + StMaker* currentChain; #endif - // StHbtManager* HbtManager();//! tells cint to skip that - StHbtManager* HbtManager(); + // StHbtManager* HbtManager();//! tells cint to skip that + StHbtManager* HbtManager(); - - virtual const char *GetCVS() const - {static const char cvs[]="Tag $Name: $ $Id: StHbtMaker.h,v 1.9 2014/08/06 11:43:19 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;} + virtual const char* GetCVS() const { + static const char cvs[] = + "Tag $Name: $ $Id: StHbtMaker.h,v 1.9 2014/08/06 11:43:19 jeromel Exp $ built " __DATE__ " " __TIME__; + return cvs; + } #ifdef __ROOT__ - ClassDef(StHbtMaker,0) + ClassDef(StHbtMaker, 0) #endif }; -inline StHbtManager* StHbtMaker::HbtManager(){return mHbtManager;} -inline int StHbtMaker::Debug() const {return mDebug;} -inline void StHbtMaker::SetDebug(int d){mDebug=d;} +inline StHbtManager* StHbtMaker::HbtManager() { return mHbtManager; } +inline int StHbtMaker::Debug() const { return mDebug; } +inline void StHbtMaker::SetDebug(int d) { mDebug = d; } #endif From 9f555f975a8fa302b523d0369dc1e2c855416ea7 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Wed, 30 Nov 2022 23:28:11 +0100 Subject: [PATCH 26/30] Removed some test. --- .github/workflows/check-format.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index a4d9247ce30..085daf4ec5a 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -5,10 +5,6 @@ jobs: name: Formatting Check runs-on: ubuntu-latest steps: - - name: test_Files - uses: actions/checkout@v3 - with: - fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - name: Run clang-format style check for C/C++ files. uses: DanielWielanek/clang-format-action@main with: From 649cf024da24eb02b5cc3b22eb4ac55033366df3 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Wed, 30 Nov 2022 23:32:40 +0100 Subject: [PATCH 27/30] Update check-format.yml --- .github/workflows/check-format.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 085daf4ec5a..41c40f04b91 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -5,6 +5,11 @@ jobs: name: Formatting Check runs-on: ubuntu-latest steps: + #this is needed to get sha of central repo + - name: test_Files + uses: actions/checkout@v3 + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - name: Run clang-format style check for C/C++ files. uses: DanielWielanek/clang-format-action@main with: From f46bb3d3e0140b0f109fa9d834ddae941448b169 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Wed, 30 Nov 2022 23:42:19 +0100 Subject: [PATCH 28/30] Update check-format.yml --- .github/workflows/check-format.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 41c40f04b91..b5153aaf0b8 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -6,10 +6,10 @@ jobs: runs-on: ubuntu-latest steps: #this is needed to get sha of central repo - - name: test_Files - uses: actions/checkout@v3 - with: - fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. +# - name: test_Files +# uses: actions/checkout@v3 +# with: +# fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - name: Run clang-format style check for C/C++ files. uses: DanielWielanek/clang-format-action@main with: From b863d09d60c7805a6a42b400d45b1561f36add34 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Wed, 30 Nov 2022 23:44:21 +0100 Subject: [PATCH 29/30] Update check-format.yml --- .github/workflows/check-format.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index b5153aaf0b8..41c40f04b91 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -6,10 +6,10 @@ jobs: runs-on: ubuntu-latest steps: #this is needed to get sha of central repo -# - name: test_Files -# uses: actions/checkout@v3 -# with: -# fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + - name: test_Files + uses: actions/checkout@v3 + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - name: Run clang-format style check for C/C++ files. uses: DanielWielanek/clang-format-action@main with: From 08276b6ff5a8ac381fe1f695a4cc7eb02516c984 Mon Sep 17 00:00:00 2001 From: Daniel Wielanek Date: Thu, 1 Dec 2022 20:21:53 +0100 Subject: [PATCH 30/30] Restore pull request file --- .github/workflows/build-pull-request.yml | 136 +++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 .github/workflows/build-pull-request.yml diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml new file mode 100644 index 00000000000..0b0c97a9ae8 --- /dev/null +++ b/.github/workflows/build-pull-request.yml @@ -0,0 +1,136 @@ +name: Build Pull Request + +on: + pull_request: + paths-ignore: + - '.github/**' + - 'docs/**' + - '!.github/workflows/**' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + starenv: [root5, root6] + compiler: [gcc485, gcc11] + env: + STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }} + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 + + - name: Build with Docker + uses: docker/build-push-action@v3 + with: + build-args: | + starenv=${{ matrix.starenv }} + compiler=${{ matrix.compiler }} + tags: ghcr.io/star-bnl/star-sw-${{ env.STARENV }} + outputs: type=docker,dest=/tmp/star-sw-${{ env.STARENV }}.tar + + - name: Save built image for test jobs + uses: actions/upload-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp/star-sw-${{ env.STARENV }}.tar + + ROOT5_test: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [10, 11, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 76, 77, 78, 90, 91, 92, 102, 103, 119, 120, 121, 122, 123] + compiler: [gcc485, gcc11] + env: + STARENV: root5-${{ matrix.compiler }} + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 + - run: | + TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py -c ${{ matrix.test_id }}) + # Workaround https://sft.its.cern.ch/jira/browse/ROOT-7660 in ROOT 5 by checking the output log + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; MALLOC_CHECK_=3 $TEST_CMD 2>&1 | tee log; grep 'Run completed' log" + + ROOT5_test_doEvents: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [121, 122] + compiler: [gcc485, gcc11] + env: + STARENV: root5-${{ matrix.compiler }} + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 + - run: | + TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') + TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' IO:' log" + + ROOT5_test_find_vertex: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [102, 121, 122] + compiler: [gcc485, gcc11] + env: + STARENV: root5-${{ matrix.compiler }} + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 + - run: | + TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') + TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' StIO:' log" + + ROOT6_test_ignore_fail: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [50, 52, 54, 90, 91, 92, 119, 120] + env: + STARENV: root6-gcc485 + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v6 + - run: | + TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py -c ${{ matrix.test_id }}) + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "MALLOC_CHECK_=3 $TEST_CMD || echo 'Failed with an exit code: '\$?"