Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
uses: ./
with:
package: ${{ matrix.repository }}
- run: echo versions=${{ steps.supported-pythons.outputs.versions }}
- run: echo all=${{ steps.supported-pythons.outputs.all }}
- run: echo oldest=${{ steps.supported-pythons.outputs.oldest }}
- run: echo latest=${{ steps.supported-pythons.outputs.latest }}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ retrieve active (not end-of-life) minor versions of Python supported by a Python
| `package-ref` | branch or tag of package source |
| `no-eoas` | also omit end-of-active-support versions of Python |

| output | description |
| ---------- | ------------------------------------- |
| `versions` | Python minor versions as a JSON list |
| `oldest` | oldest supported Python minor version |
| `latest` | latest supported Python minor version |
| output | description |
| -------- | ------------------------------------- |
| `all` | Python minor versions as a JSON list |
| `oldest` | oldest supported Python minor version |
| `latest` | latest supported Python minor version |

```yaml
jobs:
Expand All @@ -26,15 +26,15 @@ jobs:
with:
package: spacetelescope/romancal
outputs:
versions: ${{ steps.supported-pythons.outputs.versions }}
all: ${{ steps.supported-pythons.outputs.all }}
oldest: ${{ steps.supported-pythons.outputs.oldest }}
latest: ${{ steps.supported-pythons.outputs.latest }}
test:
needs: supported-pythons
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(needs.supported-pythons.outputs.versions) }}
python-version: ${{ fromJSON(needs.supported-pythons.outputs.all) }}
include:
- name: run tests (oldest Python)
python-version: ${{ steps.supported-pythons.outputs.oldest }}
Expand Down
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ runs:
python-version: 3
- run: git clone https://github.com/${{ inputs.package || github.workflow_repository }} ${{ (inputs.package-ref != '' || inputs.package == '') && format('--revision={0}', inputs.package != '' && inputs.package-ref || github.workflow_sha) || '' }} ../package/
shell: bash
- id: versions
run: echo versions=$(pipx run ${{ github.action_path }}/supported_pythons.py --package-source=../package/ ${{ inputs.no-eoas == 'true' && '--no-eoas' || '' }}) >> $GITHUB_OUTPUT
- id: all
run: echo all=$(pipx run ${{ github.action_path }}/supported_pythons.py --package-source=../package/ ${{ inputs.no-eoas == 'true' && '--no-eoas' || '' }}) >> $GITHUB_OUTPUT
shell: bash
- id: oldest
run: echo oldest=$(python -c "print(${{ steps.versions.outputs.versions }}[0])") >> $GITHUB_OUTPUT
run: echo oldest=$(python -c "print(${{ steps.all.outputs.all }}[0])") >> $GITHUB_OUTPUT
shell: bash
- id: latest
run: echo latest=$(python -c "print(${{ steps.versions.outputs.versions }}[-1])") >> $GITHUB_OUTPUT
run: echo latest=$(python -c "print(${{ steps.all.outputs.all }}[-1])") >> $GITHUB_OUTPUT
shell: bash

outputs:
versions:
all:
description: "Python minor versions as a JSON list"
value: ${{ steps.versions.outputs.versions }}
value: ${{ steps.all.outputs.all }}
oldest:
description: "oldest supported Python minor version"
value: ${{ steps.oldest.outputs.oldest }}
Expand Down
Loading