|
9 | 9 | branches: [ master ]
|
10 | 10 |
|
11 | 11 | jobs:
|
| 12 | + get-python-versions: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + outputs: |
| 15 | + python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }} |
| 16 | + steps: |
| 17 | + - uses: snok/latest-python-versions@v1 |
| 18 | + id: get-python-versions-action |
| 19 | + with: |
| 20 | + min-version: 3.8 |
| 21 | + include-prereleases: false |
| 22 | + |
12 | 23 | build:
|
13 | | - |
| 24 | +needs: [get-python-versions] |
14 | 25 | runs-on: ubuntu-latest
|
15 | 26 | strategy:
|
16 | | - fail-fast: false |
17 | 27 | matrix:
|
18 | | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] |
19 | | - |
| 28 | + python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }} |
20 | 29 | steps:
|
21 | | - - uses: actions/checkout@v3 |
22 | | - - name: Set up Python ${{ matrix.python-version }} |
23 | | - uses: actions/setup-python@v3 |
24 | | - with: |
25 | | - python-version: ${{ matrix.python-version }} |
26 | | - - name: Display Python version |
27 | | - run: python -c "import sys; print(sys.version)" |
28 | | - - name: Install dependencies |
29 | | - run: | |
30 | | - python -m pip install --upgrade pip |
31 | | - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
32 | | - - name: Run Test |
33 | | - run: | |
34 | | - python test.py |
| 30 | + - uses: actions/checkout@v3 |
| 31 | + - name: Set up Python ${{ matrix.python-version }} |
| 32 | + uses: actions/setup-python@v34 with: |
| 33 | + python-version: ${{ matrix.python-version }} |
| 34 | + - name: Display Python version |
| 35 | + run: python -c "import sys; print(sys.version)" |
| 36 | + - name: Install dependencies |
| 37 | + run: | |
| 38 | + python -m pip install --upgrade pip |
| 39 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 40 | + - name: Run Test |
| 41 | + run: | |
| 42 | + python test.py |
0 commit comments