forked from actions/setup-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GitHub releases to download python versions (actions#85)
This pull-request improves `setup-python` action to add ability to download specific version of Python on flight if it is not available by default. **Details:** `setup-python` action will download and install specific Python version from GitHub releases ([actions/python-versions](https://github.com/actions/python-versions/releases)) in case the version is not found in the local cache. All versions of Python available for installation are published in [actions/python-versions](https://github.com/actions/python-versions) repository. All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/master/versions-manifest.json) file. **Installation time:** - Ubuntu / macOS: 10-20 seconds - Windows: ~ 1 minute (mostly related to fact that we use MSI installer for Python on Windows) Co-authored-by: MaksimZhukov <v-mazhuk@microsoft.com> Co-authored-by: Konrad Pabjan <konradpabjan@github.com> Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
- Loading branch information
1 parent
985150d
commit e5af64b
Showing
11 changed files
with
5,427 additions
and
4,972 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Validate 'setup-python' | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: 0 0 * * * | ||
|
||
jobs: | ||
default-version: | ||
name: Setup default version | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-16.04, ubuntu-18.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-versions-from-manifest: | ||
name: Setup ${{ matrix.python }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-16.04, ubuntu-18.04] | ||
python: [3.5.4, 3.6.7, 3.7.5, 3.8.1] | ||
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 ("Python ${{ matrix.python }}" -ne "$pythonVersion"){ | ||
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))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "1.2.3", | ||
"stable": true, | ||
"release_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.6", | ||
"files": [ | ||
{ | ||
"filename": "sometool-1.2.3-linux-x64.tar.gz", | ||
"arch": "x64", | ||
"platform": "linux", | ||
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.6/sometool-1.2.3-linux-x64.tar.gz" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.