Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Hidev Travis Laravel Package

hiqdev/hidev-travis

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Install the package via Composer:
    composer require hiqdev/hidev-travis
    
  2. Ensure HiDev is installed in your project (this plugin is a Travis CI extension for HiDev).
  3. Configure HiDev to use Travis CI by defining a .hidev.yml or hidev.yml config file with Travis-specific actions.

First Use Case

Generate a basic .hidev.yml to integrate Travis CI:

# .hidev.yml
travis:
  install:
    - composer install
  script:
    - hidev test
  after_success:
    - ./deploy.sh

Key Files to Review

  • HiDev Documentation (core tool this plugin extends)
  • Travis CI Docs (for understanding Travis-specific syntax)
  • hidev.yml (your primary configuration file for HiDev + Travis)

Implementation Patterns

Workflow Integration

  1. Travis CI Actions Use the travis key in hidev.yml to define Travis-specific stages:

    travis:
      before_install:
        - wget https://getcomposer.org/composer.phar
      install:
        - php composer.phar install --prefer-dist --no-interaction
      script:
        - hidev test
        - hidev lint
      after_success:
        - ./generate-coverage.sh
    
  2. Conditional Execution Leverage HiDev’s @if directives to conditionally run Travis actions:

    tasks:
      test:
        cmd: hidev test
        travis: "@if env(TRAVIS) == true"
    
  3. Badge Generation Use markdownBadges to auto-generate Travis CI badges in your README.md:

    travis:
      markdownBadges: true
    
  4. HiDev Task Integration Combine HiDev tasks with Travis stages:

    tasks:
      deploy:
        cmd: ./deploy.sh
        travis: "after_success"
    

Common Patterns

  • Reuse .travis.yml: While this plugin allows defining Travis actions in hidev.yml, you can still maintain a .travis.yml for backward compatibility or additional Travis-specific configurations.
  • Environment Variables: Use env() in HiDev to dynamically set Travis environment variables:
    travis:
      env:
        global:
          - secure: "ENCRYPTED_VAR"
    

Gotchas and Tips

Pitfalls

  1. Deprecated before_install Processing

    • Older versions processed before_install automatically, but newer versions require explicit .travis.yml usage. Ensure you’re not relying on legacy behavior.
  2. HiDev Version Compatibility

    • This plugin is tied to HiDev v2+. Ensure your hidev.phar is up-to-date:
      wget https://github.com/hiqdev/hidev/releases/latest/download/hidev.phar
      chmod +x hidev.phar
      
  3. Travis Matrix Conflicts

    • If using matrix.include in .travis.yml, ensure HiDev tasks are compatible with all matrix configurations. Test locally with:
      hidev test --env TRAVIS=true
      
  4. Caching Issues

    • Travis caches vendor/ by default. If HiDev tasks depend on external assets, explicitly cache them in .travis.yml:
      cache:
        directories:
          - vendor
          - $HOME/.cache/composer
      

Debugging Tips

  • Dry Runs: Use --dry-run to preview HiDev + Travis execution:
    hidev travis --dry-run
    
  • Verbose Logging: Enable debug mode for HiDev:
    hidev:
      debug: true
    
  • Travis Logs: Check the Travis CI build logs for detailed execution traces.

Extension Points

  1. Custom Config Files Override default behavior by specifying a custom config file:

    hidev travis --config=custom-hidev.yml
    
  2. Plugin Hooks Extend the plugin by creating a custom HiDev plugin that hooks into Travis actions. Example:

    // CustomHiDevPlugin.php
    namespace App\HiDev;
    
    use HiQDev\HiDev\Plugin\PluginInterface;
    
    class CustomHiDevPlugin implements PluginInterface {
        public function getConfig() {
            return [
                'travis' => [
                    'customAction' => 'echo "Custom Travis Action"',
                ],
            ];
        }
    }
    
  3. Badge Customization Modify badge generation by extending the markdownBadges logic in your hidev.yml:

    travis:
      markdownBadges:
        - name: "Custom Badge"
          url: "https://custom-badge-service.com"
    

Configuration Quirks

  • File Naming: Ensure your config file is named .hidev.yml or hidev.yml (case-sensitive on some systems).
  • YAML Syntax: Use spaces (not tabs) for indentation in hidev.yml to avoid parsing errors.
  • Travis API Limits: Avoid excessive API calls in after_success/after_failure hooks, as Travis may throttle requests.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor