diff --git a/.github/actions/pipenv/action.yml b/.github/actions/pipenv/action.yml new file mode 100644 index 000000000..181f4e8b0 --- /dev/null +++ b/.github/actions/pipenv/action.yml @@ -0,0 +1,17 @@ +name: pipenv +description: 'Install python packages with pipenv' +inputs: + python-version: + description: The python version + required: false + default: "3.9" + +runs: + using: "composite" + steps: + - name: Install pipenv dependency + shell: bash + run: pip install -r ${{ github.action_path }}/requirements.txt + - name: Prepare pipenv virtualenv + shell: bash + run: pipenv install --deploy --dev --python ${{ inputs.python-version }} diff --git a/.github/actions/pipenv/requirements.txt b/.github/actions/pipenv/requirements.txt new file mode 100644 index 000000000..8d9a77900 --- /dev/null +++ b/.github/actions/pipenv/requirements.txt @@ -0,0 +1 @@ +pipenv==2023.6.12 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cb59c3966..bde84e430 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,8 @@ updates: directory: "/" schedule: interval: "daily" + + - package-ecosystem: "pip" + directory: "/.github/actions/pipenv" + schedule: + interval: "weekly" diff --git a/docs/README.md b/docs/README.md index 04fc11ff1..9741cbad6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -62,6 +62,7 @@ Here follows the list of GitHub Actions topics available in the current document - [nexus-release-staging](#nexus-release-staging) - [pre-commit](#pre-commit) - [pre-commit-default](#pre-commit-default) + - [pipenv](#pipenv) - [rancher](#rancher) - [reportportal-prepare](#reportportal-prepare) - [reportportal-summarize](#reportportal-summarize) @@ -844,6 +845,21 @@ Or: check-github-configuration: 'false' ``` +### pipenv + +This workflow sets up a Python environment using the standard setup-python action and utilizes the pipenv action to manage Python dependencies declared in the Pipfile and based on the specified Python version + +```yml + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + id: setup-python + with: + python-version: "3.9" + - uses: Alfresco/alfresco-build-tools/.github/actions/pipenv@ref + with: + python-version: ${{ steps.setup-python.outputs.python-version }} +``` + ### rancher register or detach an EKS cluster to Rancher.