ddev / github-action-setup-ddev

Set up your GitHub Actions workflow with DDEV
GNU General Public License v3.0
35 stars 7 forks source link

Allow PHP version to be set via argument #34

Open longwave opened 4 months ago

longwave commented 4 months ago

When using this as CI, sometimes you want a matrix of different PHP versions to test against. To do this at the moment you need to disable autostart, set the version, and then manually start, e.g.

      - uses: ddev/github-action-setup-ddev@v1
        with:
          autostart: false

      - name: Setup PHP Version
        run: ddev config --php-version ${{ matrix.php }}

      - name: Start ddev
        run: ddev start

It would be nicer DX if we could just say

      - uses: ddev/github-action-setup-ddev@v1
        with:
          php-version: ${{ matrix.php }}
alexpott commented 4 months ago

Maybe it should be more flexible something like:

      - uses: ddev/github-action-setup-ddev@v1
        with:
          before-start:
            - ddev config --php-version ${{ matrix.php }}
            - ddev config --something-else ${{ matrix.something }}

Like PHP is just 1 thing you might want to vary by....

donquixote commented 3 weeks ago

Or could we have a config: key for config overrides? This would have the same structure as the config.yaml file.

      - uses: ddev/github-action-setup-ddev@v1
        with:
          ddev-config:
            php_version: ${{ matrix.php }}
donquixote commented 3 weeks ago

There could be another key for extensions.

      - uses: ddev/github-action-setup-ddev@v1
        with:
          ddev-get:
            - ddev/ddev-drupal-contrib
            - ddev/ddev-selenium-standalone-chrome
          ddev-config:
            php_version: ${{ matrix.php }}