From 827ece8278040c6f2a08e15e9f7aeab612c59c02 Mon Sep 17 00:00:00 2001 From: Lionel Untereiner Date: Fri, 2 Aug 2024 17:14:18 +0200 Subject: [PATCH] wip: change order --- .github/workflows/compliance.yml | 46 +++++++++++++------------- .github/workflows/cpu_builds.yml | 2 +- .github/workflows/gpu_builds.yml | 37 ++++++++++++++++++--- .github/workflows/integrated_tests.yml | 35 ++++++++++++++++++-- 4 files changed, 89 insertions(+), 31 deletions(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 9b1036536a7..6208fd4ac27 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -1,4 +1,4 @@ -name: Compliance Tests +name: Compliance Tests & CPU builds on: pull_request: @@ -14,7 +14,8 @@ concurrency: jobs: # Checks if PR title follows conventional semantics - semantic_pull_request: + semantic_pull_request: + name: Checks if PR title follows conventional semantics permissions: pull-requests: write # for amannn/action-semantic-pull-request to analyze PRs and statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR @@ -36,6 +37,7 @@ jobs: # Jobs will be cancelled if PR is a draft. # PR status must be "Open" to run CI. get_docker_image_tag: + name: Get TPL tag needs: [semantic_pull_request] # Everywhere in this workflow, we use the most recent ubuntu distribution available in Github Actions # to ensure maximum support of google cloud's sdk. @@ -76,6 +78,7 @@ jobs: # PR must be assigned to be merged. # This job will fail if this is not the case. if_not_unassigned_pull_request: + name: Check PR assignement needs: [semantic_pull_request] runs-on: ubuntu-22.04 steps: @@ -144,25 +147,6 @@ jobs: - name: Check that the baseline logs are modified if rebaselines are detected run: "scripts/check_baseline_log.sh" - code_coverage: - needs: - - if_not_unassigned_pull_request - - get_docker_image_tag - uses: ./.github/workflows/build_and_test.yml - secrets: inherit - with: - BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests" - CMAKE_BUILD_TYPE: Debug - CODE_COVERAGE: true - DOCKER_IMAGE_TAG: ${{ needs.get_docker_image_tag.outputs.DOCKER_IMAGE_TAG }} - DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc11 - ENABLE_HYPRE: ON - ENABLE_TRILINOS: OFF - GCP_BUCKET: geosx/ubuntu22.04-gcc11 - RUNS_ON: Runner_4core_16GB - - - # Convenience job - passes when all other jobs have passed (must pass the CUDA jobs). check_that_all_jobs_succeeded: runs-on: ubuntu-22.04 @@ -172,7 +156,6 @@ jobs: - are_submodules_in_sync - check_code_style_and_documentation - baseline_log - - code_coverage steps: - run: | echo "if_not_unassigned_pull_request: ${{needs.if_not_unassigned_pull_request.result}}" @@ -184,10 +167,27 @@ jobs: needs.check_code_style_and_documentation.result == 'success' }}" >> $GITHUB_ENV + code_coverage: + needs: + - get_docker_image_tag + - check_that_all_jobs_succeeded + uses: ./.github/workflows/build_and_test.yml + secrets: inherit + with: + BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests" + CMAKE_BUILD_TYPE: Debug + CODE_COVERAGE: true + DOCKER_IMAGE_TAG: ${{ needs.get_docker_image_tag.outputs.DOCKER_IMAGE_TAG }} + DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc11 + ENABLE_HYPRE: ON + ENABLE_TRILINOS: OFF + GCP_BUCKET: geosx/ubuntu22.04-gcc11 + RUNS_ON: Runner_4core_16GB + cpu_builds: name: CPU builds needs: - - get_docker_image_tag + - get_docker_image_tag - check_that_all_jobs_succeeded uses: ./.github/workflows/cpu_builds.yml with: diff --git a/.github/workflows/cpu_builds.yml b/.github/workflows/cpu_builds.yml index ae03ff6fcea..3780e1cbee9 100644 --- a/.github/workflows/cpu_builds.yml +++ b/.github/workflows/cpu_builds.yml @@ -83,4 +83,4 @@ jobs: GCP_BUCKET: ${{ matrix.GCP_BUCKET }} HOST_CONFIG: ${{ matrix.HOST_CONFIG }} RUNS_ON: ubuntu-22.04 - secrets: inherit \ No newline at end of file + secrets: inherit diff --git a/.github/workflows/gpu_builds.yml b/.github/workflows/gpu_builds.yml index 849a48c284c..3cb1b86f811 100644 --- a/.github/workflows/gpu_builds.yml +++ b/.github/workflows/gpu_builds.yml @@ -11,11 +11,35 @@ on: workflow_dispatch: # Workflow can be run manually jobs: + get_docker_image_tag: + # if the current added label is for GPUs + if: "${{ github.event.label.name == 'ci: run CUDA builds' && vars.COMPLIANCE_SUCCESS}}" + # Everywhere in this workflow, we use the most recent ubuntu distribution available in Github Actions + # to ensure maximum support of google cloud's sdk. + runs-on: ubuntu-22.04 + outputs: + DOCKER_IMAGE_TAG: ${{ steps.extract_docker_image_tag.outputs.DOCKER_IMAGE_TAG }} + steps: + # The TPL tag is contained in the codespaces configuration to avoid duplications. + - name: Checkout .devcontainer/devcontainer.json + uses: actions/checkout@v4.1.7 + with: + sparse-checkout: | + .devcontainer/devcontainer.json + sparse-checkout-cone-mode: false + submodules: false + lfs: false + fetch-depth: 1 + - name: Extract docker image tag + id: extract_docker_image_tag + run: | + echo "DOCKER_IMAGE_TAG=$(jq '.build.args.GEOS_TPL_TAG' -r .devcontainer/devcontainer.json)" >> "$GITHUB_OUTPUT" + # If the 'ci: run CUDA builds' PR label is found, the cuda jobs run immediately along side linux jobs. # Note: CUDA jobs should only be run if PR is ready to merge. cuda_builds: - # if the current added label is for GPUs - if: "${{ github.event.label.name == 'ci: run CUDA builds' && vars.COMPLIANCE_SUCCESS}}" + needs: + - get_docker_image_tag name: ${{ matrix.name }} strategy: # In-progress jobs will not be cancelled if there is a failure @@ -92,7 +116,7 @@ jobs: CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }} DOCKER_CERTS_DIR: ${{ matrix.DOCKER_CERTS_DIR }} DOCKER_CERTS_UPDATE_COMMAND: ${{ matrix.DOCKER_CERTS_UPDATE_COMMAND }} - DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }} + DOCKER_IMAGE_TAG: ${{ needs.get_docker_image_tag.outputs.DOCKER_IMAGE_TAG }} DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }} DOCKER_RUN_ARGS: ${{ matrix.DOCKER_RUN_ARGS }} ENABLE_HYPRE_DEVICE: ${{ matrix.ENABLE_HYPRE_DEVICE }} @@ -103,4 +127,9 @@ jobs: NPROC: ${{ matrix.NPROC }} RUNS_ON: ${{ matrix.RUNS_ON }} REQUIRED_LABEL: "ci: run CUDA builds" - secrets: inherit \ No newline at end of file + secrets: inherit + + remove_label: + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: 'ci: run CUDA builds' \ No newline at end of file diff --git a/.github/workflows/integrated_tests.yml b/.github/workflows/integrated_tests.yml index 24c65ed7606..8231524d215 100644 --- a/.github/workflows/integrated_tests.yml +++ b/.github/workflows/integrated_tests.yml @@ -6,18 +6,42 @@ on: workflow_dispatch: jobs: + get_docker_image_tag: + if: "${{ github.event.label.name == 'ci: run integrated tests' }}" + # Everywhere in this workflow, we use the most recent ubuntu distribution available in Github Actions + # to ensure maximum support of google cloud's sdk. + runs-on: ubuntu-22.04 + outputs: + DOCKER_IMAGE_TAG: ${{ steps.extract_docker_image_tag.outputs.DOCKER_IMAGE_TAG }} + steps: + # The TPL tag is contained in the codespaces configuration to avoid duplications. + - name: Checkout .devcontainer/devcontainer.json + uses: actions/checkout@v4.1.7 + with: + sparse-checkout: | + .devcontainer/devcontainer.json + sparse-checkout-cone-mode: false + submodules: false + lfs: false + fetch-depth: 1 + - name: Extract docker image tag + id: extract_docker_image_tag + run: | + echo "DOCKER_IMAGE_TAG=$(jq '.build.args.GEOS_TPL_TAG' -r .devcontainer/devcontainer.json)" >> "$GITHUB_OUTPUT" + # If the 'ci: run integrated tests' PR label is found, the integrated tests will be run immediately after the cpu jobs. # Note: The integrated tests are optional and are (for the moment) run for convenience only. run_integrated_tests: - if: "${{ github.event.label.name == 'ci: run integrated tests' }}" + needs: + - get_docker_image_tag uses: ./.github/workflows/build_and_test.yml secrets: inherit with: BUILD_AND_TEST_CLI_ARGS: --build-exe-only BUILD_TYPE: integrated_tests CMAKE_BUILD_TYPE: Release - DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }} + DOCKER_IMAGE_TAG: ${{ needs.get_docker_image_tag.outputs.DOCKER_IMAGE_TAG }} DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc11 ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF @@ -28,4 +52,9 @@ jobs: DOCKER_CERTS_DIR: "/usr/local/share/ca-certificates" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-certificates" REQUIRED_LABEL: "ci: run integrated tests" - LOCAL_BASELINE_DIR: /data/GEOS/baselines \ No newline at end of file + LOCAL_BASELINE_DIR: /data/GEOS/baselines + + remove_label: + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: 'ci: run integrated tests' \ No newline at end of file