From 8441ddc9b3108f76b83179af3baec44662db6cec Mon Sep 17 00:00:00 2001 From: Mike Carey <32496966+mike-carey@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:33:04 -0600 Subject: [PATCH] Pulls the python-version file from the working-directory (#50) * Pulls the python-version file from the working-directory * Passes cache as an input * Installs the latest version of confmerge that has not been released as a tag --- .../actions/test-render-task-definition/.python-version | 1 + .github/workflows/render-task-definition.yml | 8 ++++++-- .github/workflows/test-render-task-definition.yml | 1 + actions/render-jinjanator-template/action.yml | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .github/actions/test-render-task-definition/.python-version diff --git a/.github/actions/test-render-task-definition/.python-version b/.github/actions/test-render-task-definition/.python-version new file mode 100644 index 00000000..d4b278f0 --- /dev/null +++ b/.github/actions/test-render-task-definition/.python-version @@ -0,0 +1 @@ +3.11.7 diff --git a/.github/workflows/render-task-definition.yml b/.github/workflows/render-task-definition.yml index a6c6911e..a2c06c6b 100644 --- a/.github/workflows/render-task-definition.yml +++ b/.github/workflows/render-task-definition.yml @@ -73,6 +73,10 @@ on: description: "File containing the Python version to use. Example: .python-version" type: string default: '' + python-cache: + description: "Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry." + type: string + required: false # python requirements options requirements-file: @@ -116,8 +120,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} - python-version-file: ${{ inputs.python-version-file }} - cache: pip + python-version-file: ${{ inputs.working-directory }}/${{ inputs.python-version-file }} + cache: ${{ inputs.python-cache }} - name: 'If ssh private key provided, setup ssh agent' id: ssh diff --git a/.github/workflows/test-render-task-definition.yml b/.github/workflows/test-render-task-definition.yml index b9026bca..e769905c 100644 --- a/.github/workflows/test-render-task-definition.yml +++ b/.github/workflows/test-render-task-definition.yml @@ -28,6 +28,7 @@ jobs: defaults.yml data.yml environment: TAG=${{ github.sha }} + python-version-file: .python-version working-directory: .github/actions/test-render-task-definition secrets: aws-account-id: '1111111111' diff --git a/actions/render-jinjanator-template/action.yml b/actions/render-jinjanator-template/action.yml index 8257f8a8..c49ee26b 100644 --- a/actions/render-jinjanator-template/action.yml +++ b/actions/render-jinjanator-template/action.yml @@ -62,7 +62,7 @@ runs: steps: - name: 'Install dependencies' shell: bash - run: pip install jinjanator confmerge + run: pip install jinjanator 'confmerge @ git+https://github.com/aisbergg/python-confmerge@06ec81b41043cc76d5fc60085daf3cfed2b610b1' # no release was provided - name: 'Render' id: render