From 73c1b61341f6b9c37e95945fe024ec59ab311a04 Mon Sep 17 00:00:00 2001 From: JuanAn Garcia Date: Fri, 10 Feb 2023 19:27:19 +0100 Subject: [PATCH 1/4] Separating framework and submodule pipelines in diferent workflows --- .github/workflows/frameworkValidation.yml | 23 +++++++++++++++++++++++ .github/workflows/validation.yml | 20 +++++++++----------- 2 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/frameworkValidation.yml diff --git a/.github/workflows/frameworkValidation.yml b/.github/workflows/frameworkValidation.yml new file mode 100644 index 0000000..7d31230 --- /dev/null +++ b/.github/workflows/frameworkValidation.yml @@ -0,0 +1,23 @@ +name: Framework Validation + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + + workflow_dispatch: + +env: + CMAKE_BUILD_TYPE: Release + REST_PATH: /rest/connectorslib/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@@submodule-validation diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 5bf37f3..e0a538b 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -1,17 +1,13 @@ name: Validation on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - release: - workflow_dispatch: + workflow_call: env: CMAKE_BUILD_TYPE: Release REST_PATH: /rest/connectorslib/install + CONNECTORS_LIB_PATH: connectorslib BRANCH_NAME: ${{ github.head_ref || github.ref_name }} defaults: @@ -19,17 +15,19 @@ defaults: shell: bash jobs: - framework-validation: - uses: rest-for-physics/framework/.github/workflows/validation.yml@master - + libCheck: name: Validate library runs-on: ubuntu-latest container: image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics steps: - - uses: actions/checkout@v3 - - run: python3 pipeline/validateLibrary.py . + - uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation + with: + branch: ${{ env.BRANCH_NAME }} + repository: rest-for-physics/connectorslib + path: ${{ env.CONNECTORS_LIB_PATH }} + - run: python3 ${{ env.CONNECTORS_LIB_PATH }}/pipeline/validateLibrary.py . build-connectorslib: name: Build only connectorslib From d3670ebb4e75b83fe705cca78a8afc9a60022b6d Mon Sep 17 00:00:00 2001 From: JuanAn Garcia Date: Fri, 10 Feb 2023 19:30:53 +0100 Subject: [PATCH 2/4] Bug fix --- .github/workflows/frameworkValidation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frameworkValidation.yml b/.github/workflows/frameworkValidation.yml index 7d31230..7199e13 100644 --- a/.github/workflows/frameworkValidation.yml +++ b/.github/workflows/frameworkValidation.yml @@ -20,4 +20,4 @@ defaults: jobs: framework-validation: - uses: rest-for-physics/framework/.github/workflows/validation.yml@@submodule-validation + uses: rest-for-physics/framework/.github/workflows/validation.yml@submodule-validation From dc3cfcc2817b546bb70348848b2cdb7284d24ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Tue, 14 Feb 2023 17:41:10 +0100 Subject: [PATCH 3/4] Separating pre-commit config in a different job --- .github/workflows/validation.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index fdf7d5f..5a2b2d9 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -28,22 +28,34 @@ jobs: path: ${{ env.CONNECTORS_LIB_PATH }} - run: python3 ${{ env.CONNECTORS_LIB_PATH }}/pipeline/validateLibrary.py . + precommit-config: + name: Validate pre-commit config + runs-on: ubuntu-latest + container: + image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics + steps: + - name: Checkout connectorslib + uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation + with: + branch: ${{ env.BRANCH_NAME }} + repository: rest-for-physics/connectors + path: ${{ env.CONNECTORS_LIB_PATH }} + - name: Verify pre-commit config files match + run: | + cd ${{ env.CONNECTORS_LIB_PATH }} + curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python + build-connectorslib: name: Build only connectorslib runs-on: ubuntu-latest container: image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics steps: - - uses: actions/checkout@v3 - name: Build and install uses: rest-for-physics/framework/.github/actions/build@master with: cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_CONNECTORS=ON" branch: ${{ env.BRANCH_NAME }} - - name: Verify pre-commit config files match - run: | - cd $GITHUB_WORKSPACE - curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python - name: Load REST libraries run: | source ${{ env.REST_PATH }}/thisREST.sh From 5ab12c93aac7d3053ad84395dbc5e132b79be04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Tue, 14 Feb 2023 18:04:00 +0100 Subject: [PATCH 4/4] Bug fix --- .github/workflows/validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 5a2b2d9..abb8c82 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -38,7 +38,7 @@ jobs: uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation with: branch: ${{ env.BRANCH_NAME }} - repository: rest-for-physics/connectors + repository: rest-for-physics/connectorslib path: ${{ env.CONNECTORS_LIB_PATH }} - name: Verify pre-commit config files match run: |