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

PHP version is inaccurate #9

Closed
samihsoylu opened this issue Dec 15, 2021 · 3 comments
Closed

PHP version is inaccurate #9

samihsoylu opened this issue Dec 15, 2021 · 3 comments
Assignees

Comments

@samihsoylu
Copy link

samihsoylu commented Dec 15, 2021

Hi @MilesChou

Actions in MilesChou/composer-action/ do not check what PHP version is available while running the "composer --help" command within the testing workflow. Revealing with php -v would add certainty that it is the expected PHP version.

I say this, because I recently I encountered this
image

That the docker container PHP version appears to be 8.1 🤔

Do you see something wrong in my workflow file? This issue did not exist before.

name: CI

on:
  pull_request:
    branches: [ master ]

jobs:
  build74:
    name: PHP 7.4 Code quality check
    runs-on: ubuntu-latest
    steps:
      - uses: MilesChou/composer-action/7.4@master
      - uses: actions/checkout@v2

      - name: Validate composer.json and composer.lock
        run: composer validate --no-interaction --strict

      - name: Install dependencies
        run: composer install --prefer-dist --no-progress --no-suggest

      - name: Check for PHP syntax errors
        run: ./vendor/bin/parallel-lint --exclude vendor/ .

      - name: Validate PHP code style
        run: ./vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no .

Thank you

@samihsoylu samihsoylu changed the title Action's don't actually check PHP Version PHP version is inaccurate Dec 15, 2021
@MilesChou MilesChou self-assigned this Dec 16, 2021
@MilesChou
Copy link
Owner

Try this config

name: CI

on:
  pull_request:
    branches: [ master ]

jobs:
  build74:
    name: PHP 7.4 Code quality check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Validate composer.json and composer.lock
        uses: MilesChou/composer-action/7.4@master
        with:
          arg: validate --no-interaction --strict

      - name: Install dependencies
        uses: MilesChou/composer-action/7.4@master
        with:
          arg: install --prefer-dist --no-progress --no-suggest

      - name: Check for PHP syntax errors
        run: ./vendor/bin/parallel-lint --exclude vendor/ .

      - name: Validate PHP code style
        run: ./vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no .

@samihsoylu
Copy link
Author

Specifying "uses" under each step seems to have fixed the problem, but I don't find it clean since I need PHP in all my steps. Defining use once would have been nice.

Thank you for your help

@MilesChou
Copy link
Owner

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

2 participants