Skip to content

Commit

Permalink
chore(general): Update Redefine to use the official GitHub Action (#5815
Browse files Browse the repository at this point in the history
)

* Redefine using official GitHub Action

* Update pr-test.yml

---------

Co-authored-by: Saar Ettinger <[email protected]>
  • Loading branch information
GerevSec and Saarett authored Dec 6, 2023
1 parent 2ea299c commit a80ecbe
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,25 @@ jobs:
# list all dependencies to get a better view about installed package versions
pipenv run pip list
pipenv run pip install redefine --index-url https://pip.redefine.dev
- name: Get venv path
id: get-venv
run: |
echo "venv=$(pipenv --venv)" >> "$GITHUB_OUTPUT"
- name: Run Redefine.dev
uses: redefinedev/redefine-action@main
with:
auth: ${{ secrets.REDEFINE_AUTH }}
python-venv-path: ${{ steps.get-venv.outputs.venv }}
testing-framework: pytest
# mode is "discover" if github.ref is "refs/heads/main" otherwise it's the value of inputs.redefine-mode
mode: discover
config-args: matrix_value=${{ matrix.python }}

- name: Unit tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REDEFINE_AUTH: ${{ secrets.REDEFINE_AUTH }}
run: |
pipenv run redefine config set stable_branch=main matrix_value=${{ matrix.python }}
pipenv run redefine start --pytest --discover
pipenv run python -m pytest tests
run: pipenv run python -m pytest tests

integration-tests:
strategy:
Expand Down Expand Up @@ -268,7 +278,7 @@ jobs:
# remove venv, if exists
pipenv --rm || true
pipenv --python ${{ env.PYTHON_VERSION }}
# 'py' package is used in 'pytest-benchmark', but 'pytest' removed it in their latest version
# 'py' package is used in 'pytest-benchmark', but 'pytest' removed it in their latest version
pipenv run pip install pytest pytest-benchmark py
pipenv run python setup.py sdist bdist_wheel
bash -c 'pipenv run pip install dist/checkov-*.whl'
Expand Down Expand Up @@ -322,7 +332,7 @@ jobs:
run: |
# remove venv, if exists
pipenv --rm || true
pipenv --python ${{ env.PYTHON_VERSION }}
pipenv --python ${{ env.PYTHON_VERSION }}
pipenv run pip install pytest pytest-xdist
pipenv run python setup.py sdist bdist_wheel
bash -c 'pipenv run pip install dist/checkov-*.whl'
Expand Down

0 comments on commit a80ecbe

Please sign in to comment.