Add test.yml to releases/v1 branch (#176)

* added test.yml

* replaced ubuntu-16.04 with ubuntu-20.04

Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
This commit is contained in:
Nikita Bykov 2021-01-04 13:16:26 +03:00 committed by GitHub
parent 152ba7c4dd
commit 9f3aa2c73d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 77 additions and 0 deletions

77
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,77 @@
name: Validate 'setup-python'
on:
pull_request:
paths-ignore:
- '**.md'
jobs:
default-version:
name: Setup default version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup default python
uses: ./
- name: Validate version
run: python --version
- name: Run simple python code
run: python -c 'import math; print(math.factorial(5))'
setup-python:
name: Setup ${{ matrix.python }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
python: [3.5, 3.6, 3.7, 3.8, 3.9]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup-python ${{ matrix.python }}
uses: ./
with:
python-version: ${{ matrix.python }}
- name: Validate version
run: |
$pythonVersion = (python --version)
if ("$pythonVersion" -notlike "Python ${{ matrix.python }}.*"){
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
exit 1
}
$pythonVersion
shell: pwsh
- name: Run simple code
run: python -c 'import math; print(math.factorial(5))'
setup-pypy:
name: Setup PyPy ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup-python pypy3
uses: ./
with:
python-version: 'pypy3'
- name: setup-python pypy2
uses: ./
with:
python-version: 'pypy2'