|
| 1 | +# This file is a template, and might need editing before it works on your project. |
| 2 | +# This is a sample GitLab CI/CD configuration file that should run without any modifications. |
| 3 | +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, |
| 4 | +# it uses echo commands to simulate the pipeline execution. |
| 5 | +# |
| 6 | +# A pipeline is composed of independent jobs that run scripts, grouped into stages. |
| 7 | +# Stages run in sequential order, but jobs within stages run in parallel. |
| 8 | +# |
| 9 | +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages |
| 10 | +# |
| 11 | +# You can copy and paste this template into a new `.gitlab-ci.yml` file. |
| 12 | +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. |
| 13 | +# |
| 14 | +# To contribute improvements to CI/CD templates, please follow the Development guide at: |
| 15 | +# https://docs.gitlab.com/ee/development/cicd/templates.html |
| 16 | +# This specific template is located at: |
| 17 | +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml |
| 18 | + |
| 19 | +default: |
| 20 | + image: drupalci/php-8.1-apache:production |
| 21 | +variables: |
| 22 | + ORCA_VERSION: dev-wip |
| 23 | + ORCA_SUT_NAME: drupal/$CI_PROJECT_TITLE |
| 24 | + ORCA_SUT_BRANCH: 1.x |
| 25 | + # ORCA_PACKAGES_CONFIG: tests/packages.yml |
| 26 | + ORCA_PACKAGES_CONFIG_ALTER: $CI_PROJECT_DIR/tests/packages_alter.yml |
| 27 | + ORCA_SUT_DIR: $CI_PROJECT_DIR |
| 28 | + ORCA_COVERAGE_ENABLE: "FALSE" |
| 29 | + # ORCA_JUNIT_LOG: $CI_PROJECT_DIR/var/logs/junit.xml |
| 30 | + # CPU allocation for containers. |
| 31 | + # Projects with complex tests are welcome to increase this. |
| 32 | + # Keeping this low helps jobs find an available runner without waiting. |
| 33 | + KUBERNETES_CPU_REQUEST: 2 |
| 34 | + # Adding extra CPU to run containers hosting chrome and chromedriver. |
| 35 | + SERVICE_CPU_REQUEST: 2 |
| 36 | + # Google env variables. |
| 37 | + # ORCA_GOOGLE_API_CLIENT_ID: ${{ secrets.ORCA_GOOGLE_API_CLIENT_ID }} |
| 38 | + # ORCA_GOOGLE_API_CLIENT_SECRET: ${{ secrets.ORCA_GOOGLE_API_CLIENT_SECRET }} |
| 39 | + # ORCA_GOOGLE_API_REFRESH_TOKEN: ${{ secrets.ORCA_GOOGLE_API_REFRESH_TOKEN }} |
| 40 | + |
| 41 | +.with-chrome: &with-chrome |
| 42 | + name: drupalci/chromedriver:production |
| 43 | + alias: chrome |
| 44 | + entrypoint: |
| 45 | + - chromedriver |
| 46 | + - "--no-sandbox" |
| 47 | + - "--log-path=/tmp/chromedriver.log" |
| 48 | + - "--verbose" |
| 49 | + - "--whitelisted-ips=" |
| 50 | + |
| 51 | +.orca_run_tests: |
| 52 | + stage: test |
| 53 | + services: |
| 54 | + - <<: *with-chrome |
| 55 | + script: |
| 56 | + - composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca $ORCA_VERSION |
| 57 | + - | |
| 58 | + php_version="$(php -r 'echo PHP_VERSION;' | cut -d '.' -f 1,2)" |
| 59 | + if [ "$ORCA_COVERAGE_ENABLE" = "TRUE" ] && [ ${php_version} = 8.1 ]; then |
| 60 | + pecl install xdebug |
| 61 | + docker-php-ext-enable xdebug |
| 62 | + echo xdebug.mode=coverage > /usr/local/etc/php/conf.d/xdebug.ini |
| 63 | + fi |
| 64 | + #curl https://gist.githubusercontent.com/rajeshreeputra/1e8ca0798a409c7eb8844681732b7745/raw/8dffc0ad60d08f20762348f60be8483e2252656d/orca-gitlab-changes.patch | git -C ../orca apply |
| 65 | + - | |
| 66 | + # We need to have dev-dependencies like phan/phan in STATIC_CODE_ANALYSIS job. |
| 67 | + if [[ "$ORCA_JOB" == "STATIC_CODE_ANALYSIS" ]]; then |
| 68 | + composer -d"../orca" install |
| 69 | + fi |
| 70 | + - ../orca/bin/ci/before_install.sh |
| 71 | + - ../orca/bin/ci/install.sh |
| 72 | + - unset ORCA_ENABLE_NIGHTWATCH |
| 73 | + - ../orca/bin/ci/script.sh |
| 74 | + after_script: |
| 75 | + - unset ORCA_COVERAGE_ENABLE |
| 76 | + - ../orca/bin/ci/after_success.sh |
| 77 | + - ../orca/bin/ci/after_failure.sh |
| 78 | + - ../orca/bin/ci/after_script.sh |
| 79 | + |
| 80 | +INTEGRATED_TEST_ON_CURRENT: |
| 81 | + extends: |
| 82 | + - .orca_run_tests |
| 83 | + variables: |
| 84 | + ORCA_JOB: "INTEGRATED_TEST_ON_CURRENT" |
| 85 | + |
| 86 | +ISOLATED_TEST_ON_CURRENT_PHP82: |
| 87 | + image: drupalci/php-8.2-apache:production |
| 88 | + extends: |
| 89 | + - .orca_run_tests |
| 90 | + variables: |
| 91 | + ORCA_JOB: "ISOLATED_TEST_ON_CURRENT" |
| 92 | + |
| 93 | +ISOLATED_TEST_ON_CURRENT: |
| 94 | + extends: |
| 95 | + - .orca_run_tests |
| 96 | + variables: |
| 97 | + ORCA_JOB: "ISOLATED_TEST_ON_CURRENT" |
| 98 | + |
| 99 | +ISOLATED_TEST_ON_CURRENT_DEV: |
| 100 | + extends: |
| 101 | + - .orca_run_tests |
| 102 | + variables: |
| 103 | + ORCA_JOB: "ISOLATED_TEST_ON_CURRENT_DEV" |
| 104 | + |
| 105 | +STRICT_DEPRECATED_CODE_SCAN: |
| 106 | + extends: |
| 107 | + - .orca_run_tests |
| 108 | + variables: |
| 109 | + ORCA_JOB: "STRICT_DEPRECATED_CODE_SCAN" |
| 110 | + |
| 111 | +ISOLATED_TEST_ON_NEXT_MINOR: |
| 112 | + extends: |
| 113 | + - .orca_run_tests |
| 114 | + variables: |
| 115 | + ORCA_JOB: "ISOLATED_TEST_ON_NEXT_MINOR" |
| 116 | + |
| 117 | +ISOLATED_TEST_ON_NEXT_MINOR_DEV: |
| 118 | + extends: |
| 119 | + - .orca_run_tests |
| 120 | + variables: |
| 121 | + ORCA_JOB: "ISOLATED_TEST_ON_NEXT_MINOR_DEV" |
| 122 | + |
| 123 | +LOOSE_DEPRECATED_CODE_SCAN: |
| 124 | + extends: |
| 125 | + - .orca_run_tests |
| 126 | + variables: |
| 127 | + ORCA_JOB: "LOOSE_DEPRECATED_CODE_SCAN" |
| 128 | + |
| 129 | +INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER: |
| 130 | + extends: |
| 131 | + - .orca_run_tests |
| 132 | + variables: |
| 133 | + ORCA_JOB: "INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER" |
| 134 | + |
| 135 | +ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV: |
| 136 | + extends: |
| 137 | + - .orca_run_tests |
| 138 | + variables: |
| 139 | + ORCA_JOB: "ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV" |
| 140 | + |
| 141 | +STATIC_CODE_ANALYSIS: |
| 142 | + extends: |
| 143 | + - .orca_run_tests |
| 144 | + variables: |
| 145 | + ORCA_JOB: "STATIC_CODE_ANALYSIS" |
| 146 | + |
| 147 | +INTEGRATED_TEST_ON_OLDEST_SUPPORTED: |
| 148 | + extends: |
| 149 | + - .orca_run_tests |
| 150 | + variables: |
| 151 | + ORCA_JOB: "INTEGRATED_TEST_ON_OLDEST_SUPPORTED" |
| 152 | + |
| 153 | +INTEGRATED_TEST_ON_LATEST_LTS: |
| 154 | + extends: |
| 155 | + - .orca_run_tests |
| 156 | + variables: |
| 157 | + ORCA_JOB: "INTEGRATED_TEST_ON_LATEST_LTS" |
| 158 | + |
| 159 | +INTEGRATED_TEST_ON_PREVIOUS_MINOR: |
| 160 | + extends: |
| 161 | + - .orca_run_tests |
| 162 | + variables: |
| 163 | + ORCA_JOB: "INTEGRATED_TEST_ON_PREVIOUS_MINOR" |
0 commit comments