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

fix: tests-pytest/action.yml: inputs: add skip-install #427

Conversation

anscfrisson
Copy link
Contributor

@anscfrisson anscfrisson commented Mar 18, 2024

This PR proposes add a missing definition of the skip-install input in tests-pytest/action.yml:

  skip-install:
    description: >
      Whether to skip install. 
      Should be false with poetry as build-backend.
      The default value is ``false``.
    default: false
    required: false
    type: boolean

Noticed with https://github.com/ansys-internal/simba-core/actions/runs/8327410143/job/22785207488

Run if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
/home/runner/work/_temp/508acb6f-5ce8-452e-84cd-fd2b2305b3de.sh: line 2: poetry: command not found

This is because inputs.skip-install does not exist, then this step that installs poetry is skipped in tests-pytest/action.yml

    - name: "Install project (if required)"
      if: inputs.skip-install == 'false'
      shell: bash
      run: |
        if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
          python -m pip install poetry
          poetry install
        else
          python -m pip install .
        fi

Then, with skip-install: false added:
https://github.com/ansys-internal/simba-core/pull/6/commits/191f76402b87d06257706c40c0129dbebc86011e

.github/workflows/ci_cd.yml

      - uses: ansys/actions/tests-pytest@d34d2c5cc77e0bfe0afcb6d913f38e0ad8c5f7bf
        with:
          pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html"
          skip-install: false

Then in https://github.com/ansys-internal/simba-core/actions/runs/8327598885/job/22785773885 poetry install is restored

...
Run if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
  if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
    python -m pip install poetry
    poetry install
  else
    python -m pip install .
  fi
...

@anscfrisson anscfrisson requested a review from a team as a code owner March 18, 2024 18:20
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@anscfrisson anscfrisson changed the title tests-pytest/action.yml: inputs: add skip-install fix: tests-pytest/action.yml: inputs: add skip-install Mar 18, 2024
@anscfrisson
Copy link
Contributor Author

anscfrisson commented Mar 18, 2024

https://github.com/ansys/actions/actions/runs/8331799321/job/22799487255?pr=427

Run ansys/actions/branch-name-style@main
Run branch_name=cfrisson/tests-pytests/inputs/add-skip-install
\033[[1](https://github.com/ansys/actions/actions/runs/8331799321/job/22799487255?pr=427#step:3:1);91m[ERROR]: Branch name cfrisson prefix is not valid.
Error: Process completed with exit code 1.

Re-opening new PR from renamed branch: #428

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

Successfully merging this pull request may close these issues.

None yet

1 participant