Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split ci into atomic workflows #3266

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip: change order
Lionel Untereiner committed Oct 2, 2024
commit fc2132144e6caf4a87421459698c9c51e98d0811
46 changes: 23 additions & 23 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion .github/workflows/cpu_builds.yml
Original file line number Diff line number Diff line change
@@ -83,4 +83,4 @@ jobs:
GCP_BUCKET: ${{ matrix.GCP_BUCKET }}
HOST_CONFIG: ${{ matrix.HOST_CONFIG }}
RUNS_ON: ubuntu-22.04
secrets: inherit
secrets: inherit
37 changes: 33 additions & 4 deletions .github/workflows/gpu_builds.yml
Original file line number Diff line number Diff line change
@@ -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
secrets: inherit

remove_label:
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: 'ci: run CUDA builds'
35 changes: 32 additions & 3 deletions .github/workflows/integrated_tests.yml
Original file line number Diff line number Diff line change
@@ -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
LOCAL_BASELINE_DIR: /data/GEOS/baselines

remove_label:
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: 'ci: run integrated tests'