diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff0cb9a2d7dde3750271d2cfc7f755262fc6707a..854ba85e4cd9b644fee5c3981548c4fe87fb5379 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,16 +22,23 @@ workflow: when: never - if: "$CI_MERGE_REQUEST_LABELS =~ /.*(workflow::paused|ci skip).*/" when: never + - if: $CI_MERGE_REQUEST_LABELS =~ /.*ci::web only.*/ + variables: + WEB_ONLY: "true" + CTEST_INCLUDE_REGEX: "nb-" - if: $CI_MERGE_REQUEST_IID # merge requests - if: $CI_COMMIT_TAG # tags, ogs/ogs repo only - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_PATH == "ogs/ogs"' # master, ogs/ogs repo only - if: '$CI_COMMIT_BRANCH =~ /^v[0-9]\.[0-9]\.[0-9]/ && $CI_PROJECT_PATH == "ogs/ogs"' # release branches, e.g. v6.x.x include: - - local: "/scripts/ci/extends/*.yml" + - local: "scripts/ci/extends/*.yml" + - local: "/scripts/ci/pipelines/web.yml" + rules: + - if: $CI_MERGE_REQUEST_LABELS =~ /.*ci::web only.*/ - local: "/scripts/ci/pipelines/regular.yml" rules: - - if: $CI_PIPELINE_SOURCE != schedule + - if: $CI_PIPELINE_SOURCE != "schedule" && $CI_MERGE_REQUEST_LABELS !~ /.*ci::web only.*/ - local: "/scripts/ci/pipelines/scheduled.yml" rules: - - if: $CI_PIPELINE_SOURCE == schedule + - if: '$CI_PIPELINE_SOURCE == "schedule"' diff --git a/scripts/ci/jobs/build-linux-arch.yml b/scripts/ci/jobs/build-linux-arch.yml new file mode 100644 index 0000000000000000000000000000000000000000..4245d7b584ff6d11cbf37cf1a58bcd60a42902f2 --- /dev/null +++ b/scripts/ci/jobs/build-linux-arch.yml @@ -0,0 +1,13 @@ +build linux arch: + extends: + - .template-build-linux + - .test-artifacts + tags: [shell, envinf23] + needs: [meta] + timeout: 2h + variables: + BUILD_CTEST_LARGE_ON_MASTER: "true" + CMAKE_PRESET: release-all + CMAKE_ARGS: >- + -DBUILD_SHARED_LIBS=ON + -DOGS_USE_MKL=ON diff --git a/scripts/ci/jobs/build-linux.yml b/scripts/ci/jobs/build-linux.yml index b9942ff1356ab686021ebb16bf107dc1e5bef2bb..08ac74aed4f6895f1538b5986495a236a8bb6328 100644 --- a/scripts/ci/jobs/build-linux.yml +++ b/scripts/ci/jobs/build-linux.yml @@ -62,20 +62,6 @@ build linux (no deps, no procs): CMAKE_ARGS: -DOGS_BUILD_PROCESSES=SteadyStateDiffusion CMAKE_PRESET: ci-simplest -build linux arch: - extends: - - .template-build-linux - - .test-artifacts - tags: [shell, envinf23] - needs: [meta] - timeout: 2h - variables: - BUILD_CTEST_LARGE_ON_MASTER: "true" - CMAKE_PRESET: release-all - CMAKE_ARGS: >- - -DBUILD_SHARED_LIBS=ON - -DOGS_USE_MKL=ON - build linux debug with sanitizers: extends: - .template-build-linux diff --git a/scripts/ci/jobs/web-check.yml b/scripts/ci/jobs/web-check.yml new file mode 100644 index 0000000000000000000000000000000000000000..239bbf8846c8ec45974c9aaeca00b76e1ab1d690 --- /dev/null +++ b/scripts/ci/jobs/web-check.yml @@ -0,0 +1,30 @@ +check web links: + stage: check + allow_failure: true + tags: [docker] + extends: + - .rules-master-manual + needs: [ci_images, "build linux arch", "build linux petsc"] + image: $WEB_IMAGE + script: + # Copy notebook pages + - cp -rl build/*/web/content web/ + - cd web + - hugo server & + - sleep 20 + - > + linkchecker --no-warnings + --check-extern + --ignore-url='sciencedirect.com' + --ignore-url='wiley.com' + --ignore-url='doi.org' + --ignore-url='linkinghub.elsevier.com' + --ignore-url='overleaf.com' + --ignore-url='https://gitlab.opengeosys.org/ogs/ogs/-/commit/' + --ignore-url='https://gitlab.opengeosys.org/ogs/ogs/-/merge_requests/new' + --ignore-url='https://ogsstorage.blob.core.windows.net/binaries/ogs6' + --ignore-url='/css/all.css' + --ignore-url='www.grs.de' + --ignore-url='www.smartkd-concept.de' + http://localhost:1313 + - kill $! diff --git a/scripts/ci/jobs/web-deploy.yml b/scripts/ci/jobs/web-deploy.yml new file mode 100644 index 0000000000000000000000000000000000000000..661c2dc4fb027fec5d9acde5a0c51e93f91a67dc --- /dev/null +++ b/scripts/ci/jobs/web-deploy.yml @@ -0,0 +1,30 @@ +deploy web site: + stage: package + image: $WEB_IMAGE + needs: + - job: ci_images + - job: "build linux arch" + - job: "build linux petsc" + - job: release + optional: true + rules: + - if: $CI_COMMIT_TAG + - if: '$CI_COMMIT_BRANCH == "master"' + changes: + - web/**/* + - scripts/ci/jobs/web.yml + - Tests/Data/**/*.ipynb + - if: '$CI_COMMIT_BRANCH == "master"' + when: manual + allow_failure: true + script: + # Copy notebook pages + - cp -rl build/*/web/content web/ + - cd web + - yarn + - yarn build + - netlify deploy --prod --dir=public --site=$OGS_NETLIFY_SITE_ID + - yarn upload-index + cache: + paths: + - web/node_modules diff --git a/scripts/ci/jobs/web-preview.yml b/scripts/ci/jobs/web-preview.yml new file mode 100644 index 0000000000000000000000000000000000000000..646480f69af1be51135ae15ed555ac306c8a6cf0 --- /dev/null +++ b/scripts/ci/jobs/web-preview.yml @@ -0,0 +1,30 @@ +preview web site: + stage: build + image: $WEB_IMAGE + needs: [ci_images, "build linux arch", "build linux petsc"] + variables: + HUGO_ENVIRONMENT: "staging" + script: + # Copy notebook pages + - cp -rl build/*/web/content web/ + - cd web + # Symlink for prj link checks (data-link shortcode) + - ln -s ../Tests . + - yarn + - yarn build + rules: + - if: $CI_MERGE_REQUEST_ID + changes: + - web/**/* + - scripts/ci/jobs/web.yml + - Tests/Data/**/*.ipynb + artifacts: + paths: + - web/public + expire_in: 1 week + environment: + name: web preview $CI_MERGE_REQUEST_IID + url: ${ARTIFACTS_PAGES_URL}/web/public/index.html + cache: + paths: + - web/node_modules diff --git a/scripts/ci/jobs/web.yml b/scripts/ci/jobs/web.yml deleted file mode 100644 index 2d089e7d1841fd16eed771d6ae3000e533d49354..0000000000000000000000000000000000000000 --- a/scripts/ci/jobs/web.yml +++ /dev/null @@ -1,92 +0,0 @@ -check web links: - stage: check - allow_failure: true - tags: [docker] - extends: - - .rules-master-manual - needs: [ci_images, "build linux arch", "build linux petsc"] - image: $WEB_IMAGE - script: - # Copy notebook pages - - cp -rl build/*/web/content web/ - - cd web - - hugo server & - - sleep 20 - - > - linkchecker --no-warnings - --check-extern - --ignore-url='sciencedirect.com' - --ignore-url='wiley.com' - --ignore-url='doi.org' - --ignore-url='linkinghub.elsevier.com' - --ignore-url='overleaf.com' - --ignore-url='https://gitlab.opengeosys.org/ogs/ogs/-/commit/' - --ignore-url='https://gitlab.opengeosys.org/ogs/ogs/-/merge_requests/new' - --ignore-url='https://ogsstorage.blob.core.windows.net/binaries/ogs6' - --ignore-url='/css/all.css' - --ignore-url='www.grs.de' - --ignore-url='www.smartkd-concept.de' - http://localhost:1313 - - kill $! - -preview web site: - stage: build - image: $WEB_IMAGE - needs: [ci_images, "build linux arch", "build linux petsc"] - variables: - HUGO_ENVIRONMENT: "staging" - script: - # Copy notebook pages - - cp -rl build/*/web/content web/ - - cd web - # Symlink for prj link checks (data-link shortcode) - - ln -s ../Tests . - - yarn - - yarn build - rules: - - if: $CI_MERGE_REQUEST_ID - changes: - - web/**/* - - scripts/ci/jobs/web.yml - - Tests/Data/**/*.ipynb - artifacts: - paths: - - web/public - expire_in: 1 week - environment: - name: web preview $CI_MERGE_REQUEST_IID - url: ${ARTIFACTS_PAGES_URL}/web/public/index.html - cache: - paths: - - web/node_modules - -deploy web site: - stage: package - image: $WEB_IMAGE - needs: - - job: ci_images - - job: "build linux arch" - - job: "build linux petsc" - - job: release - optional: true - rules: - - if: $CI_COMMIT_TAG - - if: '$CI_COMMIT_BRANCH == "master"' - changes: - - web/**/* - - scripts/ci/jobs/web.yml - - Tests/Data/**/*.ipynb - - if: '$CI_COMMIT_BRANCH == "master"' - when: manual - allow_failure: true - script: - # Copy notebook pages - - cp -rl build/*/web/content web/ - - cd web - - yarn - - yarn build - - netlify deploy --prod --dir=public --site=$OGS_NETLIFY_SITE_ID - - yarn upload-index - cache: - paths: - - web/node_modules diff --git a/scripts/ci/pipelines/regular.yml b/scripts/ci/pipelines/regular.yml index 825fd45b9d5e9237407086b4533e6d5f2c425cfe..839fd99e4d549539cdf56c2ca315f710d57dc9da 100644 --- a/scripts/ci/pipelines/regular.yml +++ b/scripts/ci/pipelines/regular.yml @@ -4,6 +4,7 @@ include: # jobs, can be indiviually disabled for testing - local: "/scripts/ci/jobs/pre-commit.yml" - local: "/scripts/ci/jobs/build-linux.yml" + - local: "/scripts/ci/jobs/build-linux-arch.yml" - local: "/scripts/ci/jobs/build-linux-petsc.yml" - local: "/scripts/ci/jobs/build-linux-frontend.yml" - local: "/scripts/ci/jobs/build-docs.yml" @@ -20,7 +21,9 @@ include: - local: "/scripts/ci/jobs/include-what-you-use.yml" - local: "/scripts/ci/jobs/clang-sanitizer.yml" - local: "/scripts/ci/jobs/clang-tidy.yml" - - local: "/scripts/ci/jobs/web.yml" + - local: "/scripts/ci/jobs/web-preview.yml" + - local: "/scripts/ci/jobs/web-check.yml" + - local: "/scripts/ci/jobs/web-deploy.yml" - local: "/scripts/ci/jobs/container.yml" - local: "/scripts/ci/jobs/release.yml" - local: "/scripts/ci/jobs/package.yml" diff --git a/scripts/ci/pipelines/web.yml b/scripts/ci/pipelines/web.yml new file mode 100644 index 0000000000000000000000000000000000000000..579d9635edb5a4257ee43f654290bb66be7eff8a --- /dev/null +++ b/scripts/ci/pipelines/web.yml @@ -0,0 +1,7 @@ +include: + - local: "/scripts/ci/extends/*.yml" + - local: "/scripts/ci/jobs/meta.yml" + - local: "/scripts/ci/jobs/ci_images.yml" + - local: "/scripts/ci/jobs/build-linux-arch.yml" + - local: "/scripts/ci/jobs/build-linux-petsc.yml" + - local: "/scripts/ci/jobs/web-preview.yml"