|
| 1 | +version: 2.1 |
| 2 | + |
| 3 | +defaults: &defaults |
| 4 | + working_directory: ~/repo |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + <<: *defaults |
| 9 | + |
| 10 | + docker: |
| 11 | + - image: php:8.1 |
| 12 | + |
| 13 | + steps: |
| 14 | + - checkout |
| 15 | + |
| 16 | + - run: |
| 17 | + name: Install dependencies |
| 18 | + command: | |
| 19 | + apt-get update -yqq |
| 20 | + apt-get install -yqq git libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev libonig-dev libzip-dev nodejs |
| 21 | +
|
| 22 | + # Install PHP extensions |
| 23 | + docker-php-ext-install mbstring pdo_pgsql curl intl gd xml zip bz2 opcache |
| 24 | +
|
| 25 | + # Install Composer |
| 26 | + curl -sS https://getcomposer.org/installer | php |
| 27 | +
|
| 28 | + # Install NVM and Yarn |
| 29 | + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash |
| 30 | + export NVM_DIR="$HOME/.nvm" && . "$NVM_DIR/nvm.sh" --no-use |
| 31 | + nvm install && nvm use |
| 32 | + npm install --global yarn |
| 33 | +
|
| 34 | + - run: |
| 35 | + name: Validate and build composer packages |
| 36 | + command: | |
| 37 | + cd drupal && php ../composer.phar validate && php ../composer.phar install |
| 38 | +
|
| 39 | + # @TODO - Circle not seeing NPM |
| 40 | + # - run: |
| 41 | + # name: Install and build Nuxt |
| 42 | + # command: | |
| 43 | + # which npm |
| 44 | + # cd nuxt && npm install && NUXT_TELEMETRY_DISABLED=1 npm run build |
| 45 | + |
| 46 | + # - run: |
| 47 | + # name: Install Codecov |
| 48 | + # command: cd nuxt && yarn add codecov |
| 49 | + |
| 50 | + - restore_cache: |
| 51 | + keys: |
| 52 | + - v1-dependencies-{{ checksum "drupal/composer.json" }}-{{ checksum "nuxt/package.json" }} |
| 53 | + # fallback to using the latest cache if no exact match is found. |
| 54 | + - v1-dependencies- |
| 55 | + |
| 56 | + # - save_cache: |
| 57 | + # paths: |
| 58 | + # - drupal/vendor |
| 59 | + # - nuxt/node_modules |
| 60 | + # key: v1-dependencies-{{ checksum "drupal/composer.json" }}-{{ checksum "nuxt/package.json" }} |
| 61 | + |
| 62 | + - persist_to_workspace: |
| 63 | + root: ~/repo |
| 64 | + paths: |
| 65 | + - . |
| 66 | + |
| 67 | + # lint: |
| 68 | + # <<: *defaults |
| 69 | + # steps: |
| 70 | + # - attach_workspace: |
| 71 | + # at: ~/repo |
| 72 | + |
| 73 | + # - run: |
| 74 | + # name: Run lint |
| 75 | + # command: yarn lint --format ./node_modules/eslint-junit/index.js |
| 76 | + # environment: |
| 77 | + # ESLINT_JUNIT_OUTPUT: ./reports/junit/eslint.xml |
| 78 | + |
| 79 | + # - run: |
| 80 | + # name: Renovate config validator |
| 81 | + # command: yarn lint:renovate |
| 82 | + |
| 83 | + # - run: |
| 84 | + # name: Bundlewatch |
| 85 | + # command: yarn bundlewatch |
| 86 | + |
| 87 | + # test_unit: |
| 88 | + # <<: *defaults |
| 89 | + # steps: |
| 90 | + # - attach_workspace: |
| 91 | + # at: ~/repo |
| 92 | + |
| 93 | + # - run: |
| 94 | + # name: Run unit tests |
| 95 | + # command: yarn test:unit --reporters=jest-junit --runInBand |
| 96 | + # environment: |
| 97 | + # JEST_JUNIT_OUTPUT_DIR: ./reports/junit/ |
| 98 | + # NODE_OPTIONS: --max_old_space_size=8192 |
| 99 | + |
| 100 | + # - run: |
| 101 | + # name: Upload coverage report |
| 102 | + # command: yarn dlx codecov |
| 103 | + |
| 104 | + # - store_test_results: |
| 105 | + # path: ./reports/junit/ |
| 106 | + |
| 107 | + # - store_artifacts: |
| 108 | + # path: ./reports/junit |
| 109 | + |
| 110 | + test_e2e: |
| 111 | + machine: |
| 112 | + image: ubuntu-2004:2022.07.1 |
| 113 | + working_directory: ~/repo |
| 114 | + environment: |
| 115 | + DDEV_NONINTERACTIVE: "true" |
| 116 | + steps: |
| 117 | + - attach_workspace: |
| 118 | + at: ~/repo |
| 119 | + |
| 120 | + - run: |
| 121 | + name: Install ddev |
| 122 | + command: | |
| 123 | + curl -LO https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh && bash install_ddev.sh |
| 124 | +
|
| 125 | + - run: |
| 126 | + name: Setup .env |
| 127 | + command: cp .env.example .env |
| 128 | + |
| 129 | + - run: |
| 130 | + name: Start server running |
| 131 | + command: | |
| 132 | + cd drupal && ddev start -y |
| 133 | +
|
| 134 | + - run: |
| 135 | + name: Install Drupal |
| 136 | + command: | |
| 137 | + cd drupal && ddev drupal-install |
| 138 | +
|
| 139 | + - run: |
| 140 | + name: Install cypress |
| 141 | + command: npx cypress install |
| 142 | + |
| 143 | + - run: |
| 144 | + name: Run end-to-end tests |
| 145 | + command: cd nuxt && npm run test:e2e |
| 146 | + |
| 147 | + # - store_artifacts: |
| 148 | + # path: ./examples/druxt-site/test/cypress/screenshots |
| 149 | + # - store_artifacts: |
| 150 | + # path: ./examples/druxt-site/test/cypress/videos |
| 151 | + |
| 152 | + # - run: |
| 153 | + # name: Run DruxtJS.org end-to-end tests |
| 154 | + # command: yarn docs:test |
| 155 | + # - store_artifacts: |
| 156 | + # path: ./docs/nuxt/test/cypress/screenshots |
| 157 | + # - store_artifacts: |
| 158 | + # path: ./docs/nuxt/test/cypress/videos |
| 159 | + |
| 160 | +workflows: |
| 161 | + version: 2 |
| 162 | + |
| 163 | + build_test: |
| 164 | + jobs: |
| 165 | + - build |
| 166 | + # - lint: |
| 167 | + # requires: |
| 168 | + # - build |
| 169 | + # - test_unit: |
| 170 | + # requires: |
| 171 | + # - build |
| 172 | + # - test_e2e: |
| 173 | + # requires: |
| 174 | + # - build |
0 commit comments