|
| 1 | +name: Validate 'setup-python' |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + paths-ignore: |
| 5 | + - '**.md' |
| 6 | + |
| 7 | +jobs: |
| 8 | + default-version: |
| 9 | + name: Setup default version |
| 10 | + runs-on: ${{ matrix.os }} |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: setup default python |
| 20 | + uses: ./ |
| 21 | + |
| 22 | + - name: Validate version |
| 23 | + run: python --version |
| 24 | + |
| 25 | + - name: Run simple python code |
| 26 | + run: python -c 'import math; print(math.factorial(5))' |
| 27 | + |
| 28 | + setup-python: |
| 29 | + name: Setup ${{ matrix.python }} ${{ matrix.os }} |
| 30 | + runs-on: ${{ matrix.os }} |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] |
| 35 | + python: [3.5, 3.6, 3.7, 3.8, 3.9] |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v2 |
| 39 | + |
| 40 | + - name: setup-python ${{ matrix.python }} |
| 41 | + uses: ./ |
| 42 | + with: |
| 43 | + python-version: ${{ matrix.python }} |
| 44 | + |
| 45 | + - name: Validate version |
| 46 | + run: | |
| 47 | + $pythonVersion = (python --version) |
| 48 | + if ("$pythonVersion" -notlike "Python ${{ matrix.python }}.*"){ |
| 49 | + Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}" |
| 50 | + exit 1 |
| 51 | + } |
| 52 | + $pythonVersion |
| 53 | + shell: pwsh |
| 54 | + |
| 55 | + - name: Run simple code |
| 56 | + run: python -c 'import math; print(math.factorial(5))' |
| 57 | + |
| 58 | + setup-pypy: |
| 59 | + name: Setup PyPy ${{ matrix.os }} |
| 60 | + runs-on: ${{ matrix.os }} |
| 61 | + strategy: |
| 62 | + fail-fast: false |
| 63 | + matrix: |
| 64 | + os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] |
| 65 | + steps: |
| 66 | + - name: Checkout |
| 67 | + uses: actions/checkout@v2 |
| 68 | + |
| 69 | + - name: setup-python pypy3 |
| 70 | + uses: ./ |
| 71 | + with: |
| 72 | + python-version: 'pypy3' |
| 73 | + |
| 74 | + - name: setup-python pypy2 |
| 75 | + uses: ./ |
| 76 | + with: |
| 77 | + python-version: 'pypy2' |
0 commit comments