From b028b051436b301c700d62f153722005981b96b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:33:39 +0200 Subject: [PATCH 01/16] Perform automatic PR to framework after updating framework branch --- .github/workflows/frameworkPR.yml | 39 +++++++++++++++++++++++ .github/workflows/frameworkValidation.yml | 24 -------------- 2 files changed, 39 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/frameworkPR.yml delete mode 100644 .github/workflows/frameworkValidation.yml diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml new file mode 100644 index 00000000..61be1f53 --- /dev/null +++ b/.github/workflows/frameworkPR.yml @@ -0,0 +1,39 @@ +name: Framework pull request + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +defaults: + run: + shell: bash + +jobs: + framework-PR: + runs-on: ubuntu-latest + steps: + - name: Checkout submodule + uses: actions/checkout@v3 + with: + repository: rest-for-physics/framework + path: framework + ref: master + - name: Checkout branch + run: | + cd framework + ./scripts/checkoutRemoteBranch.sh ${{ inputs.branch }} + - name: Automatic PR on framework at submodule PR + uses: ./framework/.github/actions/submodulePR + with: + branch: ${{ env.BRANCH_NAME }} + submodule: source/libraries/raw + token: ${{ secrets.REST_TOKEN }} diff --git a/.github/workflows/frameworkValidation.yml b/.github/workflows/frameworkValidation.yml deleted file mode 100644 index 496fdd69..00000000 --- a/.github/workflows/frameworkValidation.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Framework Validation - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - release: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - CMAKE_BUILD_TYPE: Release - REST_PATH: /rest/rawlib/install - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - -defaults: - run: - shell: bash - -jobs: - framework-validation: - uses: rest-for-physics/framework/.github/workflows/validation.yml@master From b0a8f80683cf38e889895b2abf6eaeb6af3c1266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:43:13 +0200 Subject: [PATCH 02/16] Moving to `uses` for actions since seems problematic while it is call in local --- .github/workflows/frameworkPR.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml index 61be1f53..a3da4025 100644 --- a/.github/workflows/frameworkPR.yml +++ b/.github/workflows/frameworkPR.yml @@ -21,18 +21,7 @@ jobs: framework-PR: runs-on: ubuntu-latest steps: - - name: Checkout submodule - uses: actions/checkout@v3 - with: - repository: rest-for-physics/framework - path: framework - ref: master - - name: Checkout branch - run: | - cd framework - ./scripts/checkoutRemoteBranch.sh ${{ inputs.branch }} - - name: Automatic PR on framework at submodule PR - uses: ./framework/.github/actions/submodulePR + - uses: rest-for-physics/framework/.github/actions/submodulePR@submodule-PR with: branch: ${{ env.BRANCH_NAME }} submodule: source/libraries/raw From 1c28969b3370824687f9ad5504603f3abb7d1643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:57:39 +0200 Subject: [PATCH 03/16] Moving to inputs token --- .github/workflows/frameworkPR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml index a3da4025..67eb00fe 100644 --- a/.github/workflows/frameworkPR.yml +++ b/.github/workflows/frameworkPR.yml @@ -25,4 +25,4 @@ jobs: with: branch: ${{ env.BRANCH_NAME }} submodule: source/libraries/raw - token: ${{ secrets.REST_TOKEN }} + token: ${{ inputs.token }} From 348ca424f269662ebcbd84da0cebe797902a1b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Fri, 28 Apr 2023 18:04:31 +0200 Subject: [PATCH 04/16] Reverting the token as it is suppose to be --- .github/workflows/frameworkPR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml index 67eb00fe..a3da4025 100644 --- a/.github/workflows/frameworkPR.yml +++ b/.github/workflows/frameworkPR.yml @@ -25,4 +25,4 @@ jobs: with: branch: ${{ env.BRANCH_NAME }} submodule: source/libraries/raw - token: ${{ inputs.token }} + token: ${{ secrets.REST_TOKEN }} From a9577a8803fd743162d86636c86edd26039c227e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 13:10:40 +0200 Subject: [PATCH 05/16] New workflow to check framework-pr label on submodule PR --- .github/workflows/frameworklabel.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/frameworklabel.yml diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml new file mode 100644 index 00000000..1878bdb5 --- /dev/null +++ b/.github/workflows/frameworklabel.yml @@ -0,0 +1,8 @@ +on: + pull_request: + types: [ "opened", "reopened", "created", "closed", "synchronize", "labeled", "unlabeled"] +jobs: + label-check: + runs-on: ubuntu-latest + steps: + - uses: rest-for-physics/framework/.github/actions/framework-pr-label@submodule-PR From 9d04c20ca1c3114a607df65275556634fe1bd198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 13:35:25 +0200 Subject: [PATCH 06/16] Moving to generic pr-label action instead of custom --- .github/workflows/frameworklabel.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 1878bdb5..702253ad 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -5,4 +5,6 @@ jobs: label-check: runs-on: ubuntu-latest steps: - - uses: rest-for-physics/framework/.github/actions/framework-pr-label@submodule-PR + - uses: rest-for-physics/framework/.github/actions/pr-label@submodule-PR + with: + label: framework-pr From 76a5f643cdf2a4d46eded30f94329d73239b329b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 18:09:14 +0200 Subject: [PATCH 07/16] Implementing generic methods for pr-label action --- .github/workflows/frameworklabel.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 702253ad..001dfa1a 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -5,6 +5,13 @@ jobs: label-check: runs-on: ubuntu-latest steps: - - uses: rest-for-physics/framework/.github/actions/pr-label@submodule-PR - with: - label: framework-pr + - id: label-check + uses: rest-for-physics/framework/.github/actions/pr-label@submodule-PR + with: + label: framework-pr + - name: Check label + if: steps.label-check.outputs.label-is-present == 'true' + run: | + echo "framework-pr label is present and this PR can only be merged from framework" + exit 1 + shell: bash From 7af3b8dd7b4471f59502427c1c7fc03423466daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 18:11:23 +0200 Subject: [PATCH 08/16] Yaml formatting --- .github/workflows/frameworklabel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 001dfa1a..6234588f 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -7,8 +7,8 @@ jobs: steps: - id: label-check uses: rest-for-physics/framework/.github/actions/pr-label@submodule-PR - with: - label: framework-pr + with: + label: framework-pr - name: Check label if: steps.label-check.outputs.label-is-present == 'true' run: | From 71d8672a257cfb04bcb14091a4236052f9ed06ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 18:35:47 +0200 Subject: [PATCH 09/16] Simplifiying frameworklabel action --- .github/workflows/frameworklabel.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 6234588f..3b7264bd 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -5,12 +5,8 @@ jobs: label-check: runs-on: ubuntu-latest steps: - - id: label-check - uses: rest-for-physics/framework/.github/actions/pr-label@submodule-PR - with: - label: framework-pr - name: Check label - if: steps.label-check.outputs.label-is-present == 'true' + if: "contains(github.event.pull_request.labels.*.name, 'framework-pr' }})" run: | echo "framework-pr label is present and this PR can only be merged from framework" exit 1 From 3eb6532920a2aa3f325277629343950815e53ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 18:41:17 +0200 Subject: [PATCH 10/16] Adding workflow_dispatch to framework label --- .github/workflows/frameworklabel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 3b7264bd..0f169807 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -1,6 +1,8 @@ on: pull_request: types: [ "opened", "reopened", "created", "closed", "synchronize", "labeled", "unlabeled"] +# Allows you to run this workflow manually from the Actions tab + workflow_dispatch: jobs: label-check: runs-on: ubuntu-latest From 1154464d3723555f426b7a07971d70af7ef48920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 18:43:26 +0200 Subject: [PATCH 11/16] Bug fix --- .github/workflows/frameworklabel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 0f169807..698f66bd 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check label - if: "contains(github.event.pull_request.labels.*.name, 'framework-pr' }})" + if: "contains(github.event.pull_request.labels.*.name, 'framework-pr')" run: | echo "framework-pr label is present and this PR can only be merged from framework" exit 1 From e5a2ff640e9161239d126760f38c50673811bde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 20:52:34 +0200 Subject: [PATCH 12/16] Adding label for the associated rawlib-pr --- .github/workflows/frameworkPR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml index a3da4025..ab1386f9 100644 --- a/.github/workflows/frameworkPR.yml +++ b/.github/workflows/frameworkPR.yml @@ -26,3 +26,4 @@ jobs: branch: ${{ env.BRANCH_NAME }} submodule: source/libraries/raw token: ${{ secrets.REST_TOKEN }} + label: rawlib-pr From 16feb536413bd939c4ee0738031260424ea23ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 20:57:34 +0200 Subject: [PATCH 13/16] Adding name to framework label check workflow --- .github/workflows/frameworklabel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworklabel.yml index 698f66bd..b3e2069f 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworklabel.yml @@ -1,3 +1,5 @@ +name: "Framework-pr label check" + on: pull_request: types: [ "opened", "reopened", "created", "closed", "synchronize", "labeled", "unlabeled"] From 2d59cdc85d44ee27d9c592b927eca74b5a6b1ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 22:00:19 +0200 Subject: [PATCH 14/16] Adding concurrency to frameworkPR workflow --- .github/workflows/frameworkPR.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml index ab1386f9..0d26c3a9 100644 --- a/.github/workflows/frameworkPR.yml +++ b/.github/workflows/frameworkPR.yml @@ -1,15 +1,16 @@ name: Framework pull request on: - push: - branches: [ "master" ] pull_request: branches: [ "master" ] - release: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} From e5b2efdadf8af29d310ad1a77fa8539bed78e323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Sat, 29 Apr 2023 22:29:28 +0200 Subject: [PATCH 15/16] Update and rename frameworklabel.yml to frameworkmerge.yml --- .github/workflows/{frameworklabel.yml => frameworkmerge.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{frameworklabel.yml => frameworkmerge.yml} (91%) diff --git a/.github/workflows/frameworklabel.yml b/.github/workflows/frameworkmerge.yml similarity index 91% rename from .github/workflows/frameworklabel.yml rename to .github/workflows/frameworkmerge.yml index b3e2069f..64c77fa8 100644 --- a/.github/workflows/frameworklabel.yml +++ b/.github/workflows/frameworkmerge.yml @@ -1,4 +1,4 @@ -name: "Framework-pr label check" +name: "Merge PR from framework is required" on: pull_request: From a7dca8767cc60d6ab51bf656939c7154e97f03d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Fri, 19 May 2023 09:50:29 +0200 Subject: [PATCH 16/16] Update pr-badge.yml --- .github/pr-badge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pr-badge.yml b/.github/pr-badge.yml index f51e6cac..ca73586e 100644 --- a/.github/pr-badge.yml +++ b/.github/pr-badge.yml @@ -15,5 +15,5 @@ when: "$additions < 100" - imageUrl: "https://gitlab.cern.ch/rest-for-physics/rawlib/badges/$branchName/pipeline.svg" url: "https://gitlab.cern.ch/rest-for-physics/rawlib/-/commits/$branchName" -- imageUrl: "https://github.com/rest-for-physics/rawlib/actions/workflows/frameworkValidation.yml/badge.svg?branch=$branchName" - url: "https://github.com/rest-for-physics/rawlib/commits/$branchName" +- imageUrl: "https://github.com/rest-for-physics/framework/actions/workflows/validation.yml/badge.svg?branch=$branchName" + url: "https://github.com/rest-for-physics/framework/commits/$branchName"