ddev / github-action-setup-ddev

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

Allow PHP version to be set via argument #34

Open longwave opened 1 month ago

longwave commented 1 month 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 1 month 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....