diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f9e30a1..be29b3020 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,13 @@ on: [push] name: CI -env: - SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal" - SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" - THEME_NAME: hdbt - SYMFONY_DEPRECATIONS_HELPER: disabled jobs: tests: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.0', '8.1'] + php-versions: ['8.1'] container: image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine - - services: - db: - image: mariadb:10.11 - env: - MYSQL_USER: drupal - MYSQL_PASSWORD: drupal - MYSQL_DATABASE: drupal - MYSQL_ROOT_PASSWORD: drupal - ports: - - 3306:3306 - steps: - uses: actions/checkout@v3 with: @@ -33,11 +16,16 @@ jobs: - name: Set variables run: echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV + - name: Parse $THEME_NAME from composer.json + run: echo "THEME_NAME=$(cat composer.json | jq -r .name | awk -F/ '{print $NF}')" >> $GITHUB_ENV + + - name: Clone platform + run: git clone https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT + - name: Build project run: | - composer create-project city-of-helsinki/drupal-helfi-platform:dev-main $DRUPAL_ROOT --no-interaction --repository https://repository.drupal.hel.ninja/ cd $DRUPAL_ROOT - echo "$(jq --indent 4 '.repositories |= [{"type": "path", "url": "'$GITHUB_WORKSPACE'"}] + .' composer.json)" > composer.json + composer config repositories.5 path $GITHUB_WORKSPACE composer require drupal/$THEME_NAME -W - name: Check that theme is not built with dev mode diff --git a/hdbt.theme b/hdbt.theme index a5bfc4d79..1ceb16edf 100644 --- a/hdbt.theme +++ b/hdbt.theme @@ -1597,7 +1597,7 @@ function hdbt_preprocess_paragraph__school_search(array &$variables) { $privacyUrl = _hdbt_eu_cookie_compliance_get_privacy_policy_url(); - if ($privacyUrl instanceof \Drupal\Core\Url) { + if ($privacyUrl instanceof Url) { $privacyUrl->setAbsolute(); $variables['#attached']['drupalSettings']['helfi_school_search']['cookie_privacy_url'] = $privacyUrl->toString(); }