Giter Site home page Giter Site logo

Comments (9)

q0rban avatar q0rban commented on May 25, 2024

@Chris-Archer-Upbeat you might need to run docker-php-ext-install bcmath in your commands prior to running that composer command.

from drupal9ci.

Chris-Archer-Upbeat avatar Chris-Archer-Upbeat commented on May 25, 2024

Are okay so something like this:

## Job to run Unit and Kernel tests. unit_kernel_tests: &unit_kernel_tests <<: *defaults steps: - run: name: Install PHP bcmath command: docker-php-ext-install bcmath - checkout - *copy_robo - restore_cache: *restore_cache - run: name: Run PHPUnit tests command: robo job:run-unit-tests - store_test_results: path: /var/www/html/artifacts/phpunit - store_artifacts: path: /var/www/html/artifacts - save_cache: *save_cache

from drupal9ci.

q0rban avatar q0rban commented on May 25, 2024

Possibly, though it's hard to tell based on the formatting of the code. :)

from drupal9ci.

Chris-Archer-Upbeat avatar Chris-Archer-Upbeat commented on May 25, 2024

This worked! :)

Would be good if we could have docker-php-ext-install bcmath run in the docker container.


# Reusable steps.

## Copies .circle/Robofile to the repository root.
copy_robo: &copy_robo
  run:
    name: Copy RoboFile.php
    command: cp .circleci/RoboFile.php .

## Install PHP dependencies.
php_dependencies: &php_dependencies
  run:
    name: Update PHP Dependencies
    command: docker-php-ext-install bcmath

## Defines images and working directory.
defaults: &defaults
  docker:
    - image: juampynr/drupal8ci:latest

    - image: selenium/standalone-chrome-debug:3.7.1-beryllium

    - image: mariadb:10.3
      environment:
        MYSQL_ALLOW_EMPTY_PASSWORD: 1

  working_directory: /var/www/html

## Defines the cache restoring mechanism.
restore_cache: &restore_cache
  # We use the composer.lock as a way to determine if we can cache our build.
  keys:
  - v1-dependencies-{{ checksum "composer.lock" }}
  # fallback to using the latest cache if no exact match is found
  - v1-dependencies-

## Defines the cache saving mechanism.
save_cache: &save_cache
  paths:
    - ./vendor
  key: v1-dependencies-{{ checksum "composer.lock" }}

#Jobs

## Job to run Unit and Kernel tests.
unit_kernel_tests: &unit_kernel_tests
  <<: *defaults
  steps:
    - *php_dependencies
    - checkout
    - *copy_robo
    - restore_cache: *restore_cache
    - run:
        name: Run PHPUnit tests
        command: robo job:run-unit-tests
    - store_test_results:
        path: /var/www/html/artifacts/phpunit
    - store_artifacts:
        path: /var/www/html/artifacts
    - save_cache: *save_cache

## Job to run the update path and Behat tests.
behat_tests: &behat_tests
  <<: *defaults
  steps:
    - *php_dependencies
    - checkout
    - *copy_robo
    - restore_cache: *restore_cache
    - run:
        name: Run Behat tests
        command: robo job:run-behat-tests
    - save_cache: *save_cache
    - store_test_results:
        path: /var/www/html/artifacts/behat
    - store_artifacts:
        path: /var/www/html/artifacts

## Job to check coding standards.
code_sniffer: &code_sniffer
  <<: *defaults
  steps:
    - *php_dependencies
    - checkout
    - *copy_robo
    - restore_cache: *restore_cache
    - run:
        name: Inspect coding standards
        command: robo job:check-coding-standards
    - store_test_results:
        path: /var/www/html/artifacts/phpcs
    - store_artifacts:
        path: /var/www/html/artifacts
    - save_cache: *save_cache

## Job to check test coverage.
code_coverage: &code_coverage
  <<: *defaults
  steps:
    - *php_dependencies
    - checkout
    - *copy_robo
    - restore_cache: *restore_cache
    - run:
        name: Generate code coverage report
        command: robo job:generate-coverage-report
    - store_artifacts:
        path: /var/www/html/artifacts
    - save_cache: *save_cache

# Declare all of the jobs we should run.
version: 2
jobs:
  run-unit-kernel-tests:
     <<: *unit_kernel_tests
  run-behat-tests:
     <<: *behat_tests
  run-code-sniffer:
     <<: *code_sniffer
  run-code-coverage:
     <<: *code_coverage

# Declare a workflow that runs all of our jobs in parallel.
workflows:
  version: 2
  test_and_lint:
    jobs:
      - run-unit-kernel-tests
      - run-behat-tests
      - run-code-sniffer
      - run-code-coverage

from drupal9ci.

q0rban avatar q0rban commented on May 25, 2024

Is bcmath a necessary extension for Drupal core? Or just for Drupal Commerce?

from drupal9ci.

Chris-Archer-Upbeat avatar Chris-Archer-Upbeat commented on May 25, 2024

No bcmath is just for Drupal commerce

from drupal9ci.

juampynr avatar juampynr commented on May 25, 2024

I am okay about adding it at https://github.com/Lullabot/drupal8ci/blob/master/Dockerfile. @Chris-Archer-Upbeat are you up for creating a pull request for it? In the meantime you can install the extension when the workflow starts, right?

from drupal9ci.

Chris-Archer-Upbeat avatar Chris-Archer-Upbeat commented on May 25, 2024

PR created, hopefully I have done it correctly :)

from drupal9ci.

juampynr avatar juampynr commented on May 25, 2024

Fixed! Closing.

from drupal9ci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.