From 49fc7d5a9032efa0369d63392a0f4895d52aea7d Mon Sep 17 00:00:00 2001 From: JuanAn Garcia Date: Fri, 10 Feb 2023 19:38:41 +0100 Subject: [PATCH 1/3] 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..4a5ae86 --- /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/tracklib/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 62266cd..d7e42a6 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/tracklib/install + TRACK_LIB_PATH: tracklib 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/tracklib + path: ${{ env.TRACK_LIB_PATH }} + - run: python3 ${{ env.TRACK_LIB_PATH }}/pipeline/validateLibrary.py . build-tracklib: name: Build only tracklib From 8d5d5ed2eeb75d2e07666dd75eb9f216fa4be37d 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:34:07 +0100 Subject: [PATCH 2/3] Separate pre-commit config in a different job --- .github/workflows/validation.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 5385d7a..d410325 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -29,13 +29,29 @@ jobs: path: ${{ env.TRACK_LIB_PATH }} - run: python3 ${{ env.TRACK_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 tracklib + uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation + with: + branch: ${{ env.BRANCH_NAME }} + repository: rest-for-physics/tracklib + path: ${{ env.TRACK_LIB_PATH }} + - name: Verify pre-commit config files match + run: | + cd ${{ env.TRACK_LIB_PATH }} + curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python + build-tracklib: name: Build only tracklib 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: From 0f67cd24a00755b84f7cca0da93e33c84fa2fb23 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:50:24 +0100 Subject: [PATCH 3/3] Bug fix, fogot to remove some lines on validation --- .github/workflows/validation.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index d410325..944fcd0 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -57,10 +57,6 @@ jobs: with: cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_TRACK=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