Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes on how Gitlab tests could be run locally with GrumPHP #1

Open
hkirsman opened this issue Jun 27, 2024 · 1 comment
Open

Notes on how Gitlab tests could be run locally with GrumPHP #1

hkirsman opened this issue Jun 27, 2024 · 1 comment

Comments

@hkirsman
Copy link
Collaborator

hkirsman commented Jun 27, 2024

== Problem

Gitlab pipelines is great way of getting modules in shape but many modules are out of shape or it's not installed at all. Then after you have everything set up, it's impossible to fix 600+ issues by looking at the log of pipelines. Let's do much of the checks locally by using GrumPHP which would also be ableo to run on the staged code.

== Solution?

  1. Use GrumPHP

  2. Can we make things run in Docker so developers env would not matter?
    Something like this could be used to install the dev dependencies of the module with our custom image (not yet published)
    docker run -v "$(pwd)":/app php82-custom composer install

Executing PHP with Docker seems also to work. Based on this information https://project.pages.drupalcode.org/gitlab_templates/jobs/phpcs/ an example grumphp.yml

grumphp:
  git_hook_variables:
    EXEC_GRUMPHP_COMMAND: "docker run -v \"$(pwd)\":/app php82-custom php"
  ascii:
    failed: ~
    succeeded: ~
  tasks:
    phpcs:
      standard: "vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml"
      triggered_by: [php,inc,module,install,info,test,profile,theme]

  1. Create composer package developers can add as dev requirement for their project?
hkirsman added a commit that referenced this issue Jun 27, 2024
hkirsman added a commit that referenced this issue Jun 27, 2024
hkirsman added a commit that referenced this issue Jun 27, 2024
hkirsman added a commit that referenced this issue Jun 27, 2024
hkirsman added a commit that referenced this issue Jun 27, 2024
hkirsman added a commit that referenced this issue Jun 28, 2024
hkirsman added a commit that referenced this issue Jun 28, 2024
hkirsman added a commit that referenced this issue Jun 28, 2024
hkirsman added a commit that referenced this issue Jun 28, 2024
hkirsman added a commit that referenced this issue Jun 28, 2024
@hkirsman
Copy link
Collaborator Author

hkirsman commented Jul 1, 2024

Proof that phpcs works exactly the same as on GitLab:
2024-07-01_12-22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant