-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
[Question] How to define PHP version for Github Action #181
Comments
Hello @mimmi20
Sorry, but it's not yet possible to choose what PHP runtime to use.
=> https://github.com/mimmi20/template/blob/master/.github/workflows/ci.yml#L243 use
Digest It now used the PHP 8.2 runtime ! |
BTW, there is an alternative to PHPLint GitHub Action, if you really want to use a specific PHP runtime. Keep continue to setup PHP as you did at https://github.com/mimmi20/template/blob/master/.github/workflows/ci.yml#L230 And replace this step https://github.com/mimmi20/template/blob/master/.github/workflows/ci.yml#L242-L243 Something like :
|
My previous comment in images !!! With PHP 8.2 runtime : With PHP 8.1 runtime : With PHP 8.0 runtime : This is the limit to use PHAR built on release https://github.com/overtrue/phplint/releases/tag/9.0.3 If you want a PHAR that will run on PHP 8.0, we should compile it with BOX v3 (3.16.0) |
@mimmi20 Finally, here is an operational GitHub Actions Workflow that works like a charm !!! (tested on my private repo) On last line, you can use either a YAML config file or command options (like I did) ---
name: PHPLint
on:
push:
workflow_dispatch:
jobs:
php-lint:
name: "Linting with overtrue/phplint"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-20.04"
- "ubuntu-22.04"
php-version:
- "8.1"
- "8.2"
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: overtrue/phplint
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
- name: "Lint PHP"
run: |
curl -Ls https://github.com/overtrue/phplint/releases/download/9.0.3/phplint.phar -o /usr/local/bin/phplint
chmod +x /usr/local/bin/phplint
/usr/local/bin/phplint -vvv --no-cache |
Thanks |
Summary
I am using phplint as a Github action, and the action version got updated by Renovate from version 6.1.0 to version 9.0.3.
Now the Github action uses PHP 8.0, but I need it to run on PHP 8.1.
How may I set up the required PHP version?
Expected behaviour
no error
Actual behaviour
The text was updated successfully, but these errors were encountered: