Unverified Commit eb399c26 authored by tuutti's avatar tuutti Committed by GitHub
Browse files

Merge pull request #3 from tuutti/3261371

Issue #3261371: Fixed failing tests, migrated from gitlab to github
parents c1ce8054 3095ba0b
Loading
Loading
Loading
Loading
+69 −0
Original line number Diff line number Diff line
on: [push]
name: CI
env:
  MYSQL_ROOT_PASSWORD: drupal
  SIMPLETEST_DB: "mysql://drupal:drupal@mariadb:3306/drupal"
  SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
  DRUPAL_MODULE_NAME: "commerce_klarna_payments"
  DRUPAL_CORE_VERSION: 9.3.x
  SYMFONY_DEPRECATIONS_HELPER: disabled
jobs:
  test-contrib:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        php-version: ['8.0', '8.1']
    container:
      image: ghcr.io/tuutti/drupal-php-docker:${{ matrix.php-version }}

    services:
      mariadb:
        image: mariadb:10.5
        env:
          MYSQL_USER: drupal
          MYSQL_PASSWORD: drupal
          MYSQL_DATABASE: drupal
          MYSQL_ROOT_PASSWORD: drupal
        ports:
          - 3306:3306
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1

      - name: Set variables
        run: echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV

      # Clone Drupal core into $DRUPAL_ROOT folder.
      - name: Clone drupal
        run: git clone --depth 1 --branch "$DRUPAL_CORE_VERSION" http://git.drupal.org/project/drupal.git/ $DRUPAL_ROOT

      - name: Install required composer dependencies
        run: |
          cd $DRUPAL_ROOT
          composer config platform.php ${{ matrix.php-version }}
          composer config repositories.0 path $GITHUB_WORKSPACE
          composer require drupal/$DRUPAL_MODULE_NAME
          composer run-script drupal-phpunit-upgrade
          composer require "drush/drush ^11.0"
          composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
          composer require --dev "drupal/coder"

      - name: Install Drupal
        run: |
          cd $DRUPAL_ROOT
          php -d sendmail_path=$(which true); vendor/bin/drush --yes -v site-install minimal --db-url="$SIMPLETEST_DB"
          vendor/bin/drush en $DRUPAL_MODULE_NAME -y

      - name: Run PHPCS
        run: |
          cd $DRUPAL_ROOT
          vendor/bin/phpcs modules/contrib/$DRUPAL_MODULE_NAME --standard=Drupal --extensions=php,module,inc,install,test,info

      - name: Run PHPUnit tests
        run: |
          cd $DRUPAL_ROOT
          vendor/bin/drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
          chromedriver --port=4444 > /dev/null 2>&1 &
          php ./core/scripts/run-tests.sh --dburl $SIMPLETEST_DB --php /usr/local/bin/php --color --verbose --sqlite /tmp/test.sqlite --url $SIMPLETEST_BASE_URL $DRUPAL_MODULE_NAME

.gitlab-ci.yml

deleted100644 → 0
+0 −38
Original line number Diff line number Diff line
variables:
  DRUPAL_MODULE_NAME: commerce_klarna_payments
  SIMPLETEST_BASE_URL: http://127.0.0.1:8080
  DRUPAL_CORE_VERSION: 8.9.x
  DRUPAL_INSTALL_PROFILE: minimal
  MYSQL_DATABASE: drupal
  MYSQL_ROOT_PASSWORD: drupal
  SIMPLETEST_DB: mysql://root:drupal@mariadb/drupal
  TEST_RUNNER: core
  SYMFONY_DEPRECATIONS_HELPER: disabled

before_script:
- export PATH=$HOME/.composer/vendor/bin:$PATH
- composer global require tuutti/drupal-test-runner ^1.0
- drupal-tr
- drupal-tr run-drush-server &

services:
- mariadb:latest

test:7.3:
  image: registry.gitlab.com/tuutti/drupal-php-docker:7.3
  script:
    - drupal-tr run-tests

test:7.4:
  image: registry.gitlab.com/tuutti/drupal-php-docker:7.4
  variables:
    DRUPAL_CORE_VERSION: 9.1.x
  script:
    - drupal-tr run-tests

test:8.0:
  image: registry.gitlab.com/tuutti/drupal-php-docker:8.0
  variables:
    DRUPAL_CORE_VERSION: 9.2.x
  script:
    - drupal-tr run-tests
+2 −4

File changed.

Preview size limit exceeded, changes collapsed.

+722 −3262

File changed.

Preview size limit exceeded, changes collapsed.

+4 −4
Original line number Diff line number Diff line
@@ -18,12 +18,12 @@
  "devDependencies": {
    "@babel/core": "7.4.5",
    "@babel/preset-env": "7.4.5",
    "babel-loader": "^8.0.6",
    "riot": "^4.0.5",
    "@riotjs/compiler": "^4.2.5",
    "@riotjs/hot-reload": "4.0.0",
    "@riotjs/webpack-loader": "^4.0.0",
    "webpack": "^4.33.0",
    "webpack-cli": "^3.3.2"
    "babel-loader": "^8.2.3",
    "riot": "^4.0.5",
    "webpack": "^5.67.0",
    "webpack-cli": "^4.9.2"
  }
}
Loading