|
| 1 | +# Gitlab pipeline for SWIFT, defines the various jobs that could be ran by a |
| 2 | +# suitably registered gitlab-runner instance. |
| 3 | +# |
| 4 | +# Should only run on non-draft merge requests or pushes to the master branch, |
| 5 | +# either directly or from a merge request. Some of this logic is repeated in |
| 6 | +# the jobs. |
| 7 | +# |
| 8 | +# Peter W. Draper 20-JAN-2026. |
| 9 | + |
| 10 | +# Keep to the smaller job on MR branches and activate for all pushes to the |
| 11 | +# master branch. Don't do anything on draft MRs. |
| 12 | +workflow: |
| 13 | + rules: |
| 14 | + - if: > |
| 15 | + $CI_PIPELINE_SOURCE == "merge_request_event" && |
| 16 | + $CI_MERGE_REQUEST_DRAFT == "true" |
| 17 | + when: never |
| 18 | +
|
| 19 | + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' |
| 20 | + - if: '$CI_PIPELINE_SOURCE == "push"' |
| 21 | + - when: never |
| 22 | + |
| 23 | +# We just build, that is a job is lots of compilations and tests. Those |
| 24 | +# could be separated but tests would need to keep artefacts to preserve |
| 25 | +# context with the compilations, and we have a lot of builds based on |
| 26 | +# configure options, so each would need to be handled. That would be |
| 27 | +# inefficient as the artefacts are uploaded to the gitlab and then |
| 28 | +# retrieved. |
| 29 | + |
| 30 | +stages: |
| 31 | + - build |
| 32 | + - runtime |
| 33 | + |
| 34 | +variables: |
| 35 | + GIT_STRATEGY: clone |
| 36 | + GIT_SUBMODULE_STRATEGY: none |
| 37 | + |
| 38 | +# JOBS. |
| 39 | +# ----- |
| 40 | + |
| 41 | +# Full GCC toolchain on COSMA: |
| 42 | +gnu-build-cosma: |
| 43 | + stage: build |
| 44 | + tags: |
| 45 | + - cosma |
| 46 | + # When MR to master happens, or commit is to master. |
| 47 | + rules: |
| 48 | + - if: > |
| 49 | + $CI_PIPELINE_SOURCE == "push" && |
| 50 | + $CI_COMMIT_BRANCH == "master" |
| 51 | + timeout: 6h |
| 52 | + script: |
| 53 | + - echo "GNU toolchain compilation and unit tests (full)" |
| 54 | + - ci/COSMA/swift-gnu-check.sh |
| 55 | + - echo "complete." |
| 56 | + |
| 57 | +# Full Intel toolchain on COSMA: |
| 58 | +intel-build-cosma: |
| 59 | + stage: build |
| 60 | + tags: |
| 61 | + - cosma |
| 62 | + # When MR to master happens, or commit is to master. |
| 63 | + rules: |
| 64 | + - if: > |
| 65 | + $CI_PIPELINE_SOURCE == "push" && |
| 66 | + $CI_COMMIT_BRANCH == "master" |
| 67 | + timeout: 6h |
| 68 | + script: |
| 69 | + - echo "Intel OneAPI toolchain compilation and unit tests (full)" |
| 70 | + - ci/COSMA/swift-intel-check.sh |
| 71 | + - echo "complete." |
| 72 | + |
| 73 | +# Small runtime checks. |
| 74 | +runtime-check-cosma: |
| 75 | + stage: runtime |
| 76 | + tags: |
| 77 | + - cosma |
| 78 | + # When MR to master happens, or commit is to master. |
| 79 | + rules: |
| 80 | + - if: > |
| 81 | + $CI_PIPELINE_SOURCE == "push" && |
| 82 | + $CI_COMMIT_BRANCH == "master" |
| 83 | + timeout: 6h |
| 84 | + script: |
| 85 | + - echo "Runtime checks" |
| 86 | + - ci/COSMA/swift-runtime-check.sh |
| 87 | + - echo "complete." |
| 88 | + |
| 89 | +# Small test for MRs only. Some like to push a lot... |
| 90 | +swift-intel-build-mr: |
| 91 | + stage: build |
| 92 | + tags: |
| 93 | + - cosma |
| 94 | + # When this commit is part of an active MR. |
| 95 | + rules: |
| 96 | + - if: > |
| 97 | + $CI_PIPELINE_SOURCE == "merge_request_event" && |
| 98 | + $CI_MERGE_REQUEST_DRAFT == "false" |
| 99 | + timeout: 6h |
| 100 | + script: |
| 101 | + - echo "Merge request check using Intel toolchain" |
| 102 | + - ci/COSMA/swift-intel-check-mr.sh |
| 103 | + - echo "complete." |
| 104 | + |
| 105 | +# Whatever toolchain is provided in the runner environment. |
| 106 | +# Note this is not enabled by on the main repository, those |
| 107 | +# jobs will only run on COSMA. Comment those out or change things |
| 108 | +# to match your fork environment as needed. |
| 109 | +#gnu-build: |
| 110 | +# stage: build |
| 111 | +# tags: |
| 112 | +# - genericlinux |
| 113 | +# # When MR to master happens, or commit is to master. |
| 114 | +# rules: |
| 115 | +# - if: > |
| 116 | +# $CI_PIPELINE_SOURCE == "push" && |
| 117 | +# $CI_COMMIT_BRANCH == "master" |
| 118 | +# timeout: 6h |
| 119 | +# script: |
| 120 | +# - echo "Full compilation and unit tests" |
| 121 | +# - ci/swift-gnu-check.sh |
| 122 | +# - echo "complete." |
0 commit comments