Skip to content

AV-2055: Make avoindata_servicemessage drupal 10 compatible #2082

AV-2055: Make avoindata_servicemessage drupal 10 compatible

AV-2055: Make avoindata_servicemessage drupal 10 compatible #2082

Workflow file for this run

name: Code Quality Checks
on:
push:
branches:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
ruff:
name: ruff
runs-on: ubuntu-latest
container: python:3.11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install requirements
run: |
pip install ruff
- name: Run ruff
run: |
ruff check --format=github ckan
code-sniffer:
name: code-sniffer
runs-on: ubuntu-latest
container: php:8.1
steps:
- uses: actions/checkout@v3
- name: Install Composer
run: |
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet --version=2.1.14
RESULT=$?
rm composer-setup.php
mv composer.phar /usr/local/bin/composer
exit $RESULT
shell: sh
- name: Set up environment
run : |
apt-get update && apt-get install -y zlib1g-dev libsqlite3-dev libpng-dev libzip-dev unzip git
docker-php-ext-install gd
- run: php -d memory_limit=-1 /usr/local/bin/composer install -n --prefer-dist
working-directory: ./drupal/
- name: Ignore warnings on exit code
run: ./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
working-directory: ./drupal/
- name: Run codesniffer for drupal standard
run: ./vendor/bin/phpcs --standard=Drupal modules --ignore=*\.js
working-directory: ./drupal
- name: Run codesniffer for drupal practice
run: ./vendor/bin/phpcs --standard=DrupalPractice modules --ignore=*\.js
working-directory: ./drupal
stylelint:
name: stylelint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: opendata-assets/package-lock.json
- name: cache node_modules
uses: actions/cache@v3
id: cache-node_modules
with:
path: ./opendata-assets/node_modules
key: ${{ runner.os }}-build-node_v20-${{ hashFiles('opendata-assets/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-node_v20-
- name: Authenticate npm registry
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
run: |
cat <<EOT >> .npmrc
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=$NPM_TOKEN
EOT
working-directory: ./opendata-assets
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: install npm packages
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
run: npm ci
working-directory: ./opendata-assets
- name: run stylelint
run: npx stylelint "src/less" -f github
working-directory: ./opendata-assets
slack:
name: Slack notification
runs-on: ubuntu-latest
needs:
- ruff
- code-sniffer
- stylelint
if: failure() && github.ref == 'refs/heads/master'
steps:
- uses: 8398a7/action-slack@v3
with:
status: 'failure'
fields: repo,message,author,action,ref
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEB_HOOK }}