mirror of
https://github.com/actions/setup-python.git
synced 2025-04-20 12:03:29 +00:00
Compare commits
No commits in common. "main" and "v2.2.2" have entirely different histories.
@ -1,6 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!src/
|
|
51
.eslintrc.js
51
.eslintrc.js
@ -1,51 +0,0 @@
|
|||||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
|
||||||
module.exports = {
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'plugin:eslint-plugin-jest/recommended',
|
|
||||||
'eslint-config-prettier'
|
|
||||||
],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-require-imports': 'error',
|
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-empty-function': 'off',
|
|
||||||
'@typescript-eslint/ban-ts-comment': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
'ts-ignore': 'allow-with-description'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'no-console': 'error',
|
|
||||||
'yoda': 'error',
|
|
||||||
'prefer-const': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
destructuring: 'all'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'no-control-regex': 'off',
|
|
||||||
'no-constant-condition': ['error', {checkLoops: false}],
|
|
||||||
'node/no-extraneous-import': 'error'
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['**/*{test,spec}.ts'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
'jest/no-standalone-expect': 'off',
|
|
||||||
'jest/no-conditional-expect': 'off',
|
|
||||||
'no-console': 'off',
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
es6: true,
|
|
||||||
'jest/globals': true
|
|
||||||
}
|
|
||||||
};
|
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -1 +1 @@
|
|||||||
* @actions/setup-actions-team
|
* @actions/actions-service
|
||||||
|
50
.github/ISSUE_TEMPLATE/bug_report.md
vendored
50
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,38 +1,44 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a bug report
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: bug, needs triage
|
labels: bug
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 --->
|
**Describe the bug**
|
||||||
<!--- Before opening up a new bug report, please make sure to check for similar existing issues -->
|
|
||||||
|
|
||||||
**Description:**
|
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
**Action version:**
|
**Which version of the action are you using?**
|
||||||
Specify the action version
|
|
||||||
|
|
||||||
**Platform:**
|
- [ ] `v1`
|
||||||
- [ ] Ubuntu
|
- [ ] `v2`
|
||||||
- [ ] macOS
|
- [ ] Some other tag (such as `v2.0.1` or `master`)
|
||||||
|
|
||||||
|
**Environment**
|
||||||
|
- [ ] self-hosted
|
||||||
|
- [ ] Linux
|
||||||
- [ ] Windows
|
- [ ] Windows
|
||||||
|
- [ ] Mac
|
||||||
|
|
||||||
**Runner type:**
|
If applicable, please specify if you're using a container
|
||||||
- [ ] Hosted
|
|
||||||
- [ ] Self-hosted
|
|
||||||
|
|
||||||
**Tools version:**
|
**Python Versions**
|
||||||
<!--- Please list all of the affected Python versions (`3.8.2`, etc.)-->
|
Please list all of the effected versions of Python (`3.8.2`, etc.)
|
||||||
|
|
||||||
**Repro steps:**
|
**To Reproduce**
|
||||||
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
**Expected behavior:**
|
**Run/Repo Url**
|
||||||
A description of what you expected to happen.
|
If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate.
|
||||||
|
|
||||||
**Actual behavior:**
|
**Screenshots**
|
||||||
A description of what is actually happening.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
18
.github/ISSUE_TEMPLATE/feature_request.md
vendored
18
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: feature request, needs triage
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
<!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 --->
|
|
||||||
<!--- Before opening up a new feature request, please make sure to check for similar existing issues and pull requests -->
|
|
||||||
|
|
||||||
**Description:**
|
|
||||||
Describe your proposal.
|
|
||||||
|
|
||||||
**Justification:**
|
|
||||||
Justification or a use case for your proposal.
|
|
||||||
|
|
||||||
**Are you willing to submit a PR?**
|
|
||||||
<!--- We accept contributions! -->
|
|
22
.github/dependabot.yml
vendored
22
.github/dependabot.yml
vendored
@ -1,22 +0,0 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
# Enable version updates for npm
|
|
||||||
- package-ecosystem: 'npm'
|
|
||||||
# Look for `package.json` and `lock` files in the `root` directory
|
|
||||||
directory: '/'
|
|
||||||
# Check the npm registry for updates every day (weekdays)
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
||||||
|
|
||||||
# Enable version updates for GitHub Actions
|
|
||||||
- package-ecosystem: 'github-actions'
|
|
||||||
# Workflow files stored in the default location of `.github/workflows`
|
|
||||||
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
9
.github/pull_request_template.md
vendored
9
.github/pull_request_template.md
vendored
@ -1,9 +0,0 @@
|
|||||||
**Description:**
|
|
||||||
Describe your changes.
|
|
||||||
|
|
||||||
**Related issue:**
|
|
||||||
Add link to the related issue.
|
|
||||||
|
|
||||||
**Check list:**
|
|
||||||
- [ ] Mark if documentation changes are required.
|
|
||||||
- [ ] Mark if tests were added or updated to cover the changes.
|
|
17
.github/workflows/basic-validation.yml
vendored
17
.github/workflows/basic-validation.yml
vendored
@ -1,17 +0,0 @@
|
|||||||
name: Basic validation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
jobs:
|
|
||||||
call-basic-validation:
|
|
||||||
name: Basic validation
|
|
||||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
19
.github/workflows/check-dist.yml
vendored
19
.github/workflows/check-dist.yml
vendored
@ -1,19 +0,0 @@
|
|||||||
name: Check dist/
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-check-dist:
|
|
||||||
name: Check dist/
|
|
||||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
45
.github/workflows/codeql-analysis.yml
vendored
45
.github/workflows/codeql-analysis.yml
vendored
@ -1,13 +1,46 @@
|
|||||||
name: CodeQL analysis
|
name: "Code scanning - action"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * 0'
|
- cron: '25 3 * * 5'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-codeQL-analysis:
|
CodeQL-Build:
|
||||||
name: CodeQL analysis
|
|
||||||
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
# CodeQL runs on ubuntu-latest and windows-latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
|
# with:
|
||||||
|
# languages: go, javascript, csharp, python, cpp, java
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
|
164
.github/workflows/e2e-cache-freethreaded.yml
vendored
164
.github/workflows/e2e-cache-freethreaded.yml
vendored
@ -1,164 +0,0 @@
|
|||||||
name: e2e-cache freethread
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
jobs:
|
|
||||||
python-pip-dependencies-caching:
|
|
||||||
name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install numpy pandas requests
|
|
||||||
|
|
||||||
python-pipenv-dependencies-caching:
|
|
||||||
name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
id: cache-pipenv
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pipenv'
|
|
||||||
- name: Install pipenv
|
|
||||||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pipenv install requests
|
|
||||||
|
|
||||||
python-poetry-dependencies-caching:
|
|
||||||
name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: [3.13.0, 3.13.1, 3.13.2]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install poetry
|
|
||||||
run: pipx install poetry
|
|
||||||
- name: Init pyproject.toml
|
|
||||||
run: mv ./__tests__/data/pyproject.toml .
|
|
||||||
- name: Setup Python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
freethreaded: true
|
|
||||||
cache: 'poetry'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: poetry install --no-root
|
|
||||||
|
|
||||||
python-pip-dependencies-caching-path:
|
|
||||||
name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: __tests__/data/requirements.txt
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install numpy pandas requests
|
|
||||||
|
|
||||||
python-pipenv-dependencies-caching-path:
|
|
||||||
name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
id: cache-pipenv
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pipenv'
|
|
||||||
cache-dependency-path: '**/pipenv-requirements.txt'
|
|
||||||
- name: Install pipenv
|
|
||||||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pipenv install requests
|
|
251
.github/workflows/e2e-cache.yml
vendored
251
.github/workflows/e2e-cache.yml
vendored
@ -1,251 +0,0 @@
|
|||||||
name: e2e-cache
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
jobs:
|
|
||||||
python-pip-dependencies-caching:
|
|
||||||
name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version:
|
|
||||||
[
|
|
||||||
'3.9',
|
|
||||||
'pypy-3.9-v7.x',
|
|
||||||
'3.10',
|
|
||||||
'pypy-3.10-v7.x',
|
|
||||||
'3.11',
|
|
||||||
'pypy-3.11-v7.x',
|
|
||||||
'3.12',
|
|
||||||
'3.13'
|
|
||||||
]
|
|
||||||
exclude:
|
|
||||||
- os: windows-latest
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install numpy pandas requests
|
|
||||||
|
|
||||||
python-pipenv-dependencies-caching:
|
|
||||||
name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version:
|
|
||||||
['3.10', 'pypy-3.10-v7.x', '3.11', 'pypy-3.11-v7.x', '3.12', '3.13']
|
|
||||||
exclude:
|
|
||||||
- os: windows-latest
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
- os: ubuntu-22.04-arm
|
|
||||||
python-version: pypy-3.10-v7.x
|
|
||||||
- os: ubuntu-22.04-arm
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
- os: ubuntu-22.04-arm
|
|
||||||
python-version: pypy-3.10-v7.x
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
id: cache-pipenv
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pipenv'
|
|
||||||
- name: Install pipenv
|
|
||||||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
|
|
||||||
- name: Prepare environment
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
mv ./__tests__/data/Pipfile.lock .
|
|
||||||
mv ./__tests__/data/Pipfile .
|
|
||||||
mv ./__tests__/test-pipenv.py .
|
|
||||||
- name: Install dependencies
|
|
||||||
shell: pwsh
|
|
||||||
if: steps.cache-pipenv.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
if ("${{ matrix.python-version }}" -Match "pypy") {
|
|
||||||
pipenv install --python pypy # --keep-outdated
|
|
||||||
} else {
|
|
||||||
pipenv install --python ${{ matrix.python-version }} # --keep-outdated
|
|
||||||
}
|
|
||||||
- name: Run Python Script
|
|
||||||
run: pipenv run python test-pipenv.py
|
|
||||||
|
|
||||||
python-poetry-dependencies-caching:
|
|
||||||
name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version:
|
|
||||||
[
|
|
||||||
'3.9',
|
|
||||||
'pypy-3.9-v7.x',
|
|
||||||
'3.10',
|
|
||||||
'pypy-3.10-v7.x',
|
|
||||||
'3.11',
|
|
||||||
'pypy-3.11-v7.x',
|
|
||||||
'3.12',
|
|
||||||
'3.13'
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install poetry
|
|
||||||
run: pipx install poetry
|
|
||||||
- name: Init pyproject.toml
|
|
||||||
run: mv ./__tests__/data/pyproject.toml .
|
|
||||||
- name: Setup Python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'poetry'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: poetry install --no-root
|
|
||||||
|
|
||||||
python-pip-dependencies-caching-path:
|
|
||||||
name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version:
|
|
||||||
[
|
|
||||||
'3.9',
|
|
||||||
'pypy-3.9-v7.x',
|
|
||||||
'3.10',
|
|
||||||
'pypy-3.10-v7.x',
|
|
||||||
'3.11',
|
|
||||||
'pypy-3.11-v7.x',
|
|
||||||
'3.12',
|
|
||||||
'3.13'
|
|
||||||
]
|
|
||||||
exclude:
|
|
||||||
- os: windows-latest
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: __tests__/data/requirements.txt
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install numpy pandas requests
|
|
||||||
|
|
||||||
python-pipenv-dependencies-caching-path:
|
|
||||||
name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
windows-latest,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version:
|
|
||||||
['3.10', 'pypy-3.10-v7.x', '3.11', 'pypy-3.11-v7.x', '3.12', '3.13']
|
|
||||||
exclude:
|
|
||||||
- os: windows-latest
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
- os: ubuntu-22.04-arm
|
|
||||||
python-version: pypy-3.10-v7.x
|
|
||||||
- os: ubuntu-22.04-arm
|
|
||||||
python-version: pypy-3.11-v7.x
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python
|
|
||||||
id: cache-pipenv
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pipenv'
|
|
||||||
cache-dependency-path: '**/pipenv-requirements.txt'
|
|
||||||
- name: Install pipenv
|
|
||||||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
|
|
||||||
- name: Prepare environment
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
mv ./__tests__/data/Pipfile.lock .
|
|
||||||
mv ./__tests__/data/Pipfile .
|
|
||||||
mv ./__tests__/test-pipenv.py .
|
|
||||||
- name: Install dependencies
|
|
||||||
shell: pwsh
|
|
||||||
if: steps.cache-pipenv.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
if ("${{ matrix.python-version }}" -Match "pypy") {
|
|
||||||
pipenv install --python pypy # --keep-outdated
|
|
||||||
} else {
|
|
||||||
pipenv install --python ${{ matrix.python-version }} # --keep-outdated
|
|
||||||
}
|
|
||||||
- name: Run Python Script
|
|
||||||
run: pipenv run python test-pipenv.py
|
|
95
.github/workflows/e2e-tests.yml
vendored
95
.github/workflows/e2e-tests.yml
vendored
@ -1,95 +0,0 @@
|
|||||||
name: e2e tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-setup-python:
|
|
||||||
name: Test setup-python
|
|
||||||
runs-on: ${{ matrix.operating-system }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
operating-system:
|
|
||||||
[
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
macos-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run with setup-python 3.9.13
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 3.9.13
|
|
||||||
- name: Verify 3.9.13
|
|
||||||
run: python __tests__/verify-python.py 3.9.13
|
|
||||||
|
|
||||||
- name: Run with setup-python 3.9.13
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 3.10.11
|
|
||||||
- name: Verify 3.10.11
|
|
||||||
run: python __tests__/verify-python.py 3.10.11
|
|
||||||
|
|
||||||
- name: Run with setup-python 3.11.9
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 3.11.9
|
|
||||||
- name: Verify 3.11.9
|
|
||||||
run: python __tests__/verify-python.py 3.11.9
|
|
||||||
|
|
||||||
- name: Run with setup-python 3.12.7
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 3.12.7
|
|
||||||
- name: Verify 3.12.7
|
|
||||||
run: python __tests__/verify-python.py 3.12.7
|
|
||||||
|
|
||||||
- name: Run with setup-python 3.13.0
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 3.13.0
|
|
||||||
- name: Verify 3.13.0
|
|
||||||
run: python __tests__/verify-python.py 3.13.0
|
|
||||||
|
|
||||||
- name: Run with setup-python 3.13
|
|
||||||
id: cp313
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Verify 3.13
|
|
||||||
run: python __tests__/verify-python.py 3.13
|
|
||||||
- name: Run python-path sample 3.13
|
|
||||||
run: pipx run --python '${{ steps.cp313.outputs.python-path }}' nox --version
|
|
||||||
|
|
||||||
- name: Run with setup-python ==3.13
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: '==3.13'
|
|
||||||
- name: Verify ==3.13
|
|
||||||
run: python __tests__/verify-python.py 3.13
|
|
||||||
|
|
||||||
- name: Run with setup-python <3.13
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: '<3.13'
|
|
||||||
- name: Verify <3.13
|
|
||||||
run: python __tests__/verify-python.py 3.12
|
|
||||||
- name: Test Raw Endpoint Access
|
|
||||||
run: |
|
|
||||||
curl -L https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | jq empty
|
|
||||||
shell: bash
|
|
24
.github/workflows/licensed.yml
vendored
24
.github/workflows/licensed.yml
vendored
@ -1,14 +1,20 @@
|
|||||||
name: Licensed
|
name: Licensed
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push: {branches: main}
|
||||||
branches:
|
pull_request: {branches: main}
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-licensed:
|
test:
|
||||||
name: Licensed
|
runs-on: ubuntu-latest
|
||||||
uses: actions/reusable-workflows/.github/workflows/licensed.yml@main
|
name: Check licenses
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: npm ci
|
||||||
|
- name: Install licensed
|
||||||
|
run: |
|
||||||
|
cd $RUNNER_TEMP
|
||||||
|
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
|
||||||
|
sudo tar -xzf licensed.tar.gz
|
||||||
|
sudo mv licensed /usr/local/bin/licensed
|
||||||
|
- run: licensed status
|
20
.github/workflows/publish-immutable-actions.yml
vendored
20
.github/workflows/publish-immutable-actions.yml
vendored
@ -1,20 +0,0 @@
|
|||||||
name: 'Publish Immutable Action Version'
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checking out
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Publish
|
|
||||||
id: publish
|
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
|
28
.github/workflows/release-new-action-version.yml
vendored
28
.github/workflows/release-new-action-version.yml
vendored
@ -1,28 +0,0 @@
|
|||||||
name: Release new action version
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [released]
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
TAG_NAME:
|
|
||||||
description: 'Tag name that the major tag will point to'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_tag:
|
|
||||||
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
|
||||||
environment:
|
|
||||||
name: releaseNewActionVersion
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
|
||||||
uses: actions/publish-action@v0.3.0
|
|
||||||
with:
|
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
|
135
.github/workflows/test-graalpy.yml
vendored
135
.github/workflows/test-graalpy.yml
vendored
@ -1,135 +0,0 @@
|
|||||||
name: Validate GraalPy e2e
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup-graalpy:
|
|
||||||
name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
graalpy:
|
|
||||||
- 'graalpy-22.3'
|
|
||||||
- 'graalpy-23.0'
|
|
||||||
- 'graalpy-23.1'
|
|
||||||
- 'graalpy-24.1'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.graalpy }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.graalpy }}
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: GraalPy and Python version
|
|
||||||
run: python --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
- name: Assert GraalPy is running
|
|
||||||
run: |
|
|
||||||
import platform
|
|
||||||
assert platform.python_implementation().lower() == "graalvm"
|
|
||||||
shell: python
|
|
||||||
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE=${{ matrix.graalpy }}
|
|
||||||
EXECUTABLE=${EXECUTABLE/graalpy-/graalpy} # remove the first '-' in "graalpy-X.Y" -> "graalpyX.Y" to match executable name
|
|
||||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-graalpy-noenv:
|
|
||||||
name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }} (noenv)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
graalpy: ['graalpy22.3', 'graalpy23.0', 'graalpy23.1', 'graalpy24.1']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.graalpy }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.graalpy }}
|
|
||||||
update-environment: false
|
|
||||||
|
|
||||||
- name: GraalPy and Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
check-latest:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest, macos-13]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup GraalPy and check latest
|
|
||||||
uses: ./
|
|
||||||
id: graalpy
|
|
||||||
with:
|
|
||||||
python-version: 'graalpy-24.x'
|
|
||||||
check-latest: true
|
|
||||||
- name: GraalPy and Python version
|
|
||||||
run: python --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
- name: Assert GraalPy is running
|
|
||||||
run: |
|
|
||||||
import platform
|
|
||||||
assert platform.python_implementation().lower() == "graalvm"
|
|
||||||
shell: python
|
|
||||||
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE='${{ steps.graalpy.outputs.python-version }}'
|
|
||||||
EXECUTABLE="${EXECUTABLE%.*}"
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
236
.github/workflows/test-pypy.yml
vendored
236
.github/workflows/test-pypy.yml
vendored
@ -1,5 +1,4 @@
|
|||||||
name: Validate PyPy e2e
|
name: Validate PyPy e2e
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@ -11,7 +10,6 @@ on:
|
|||||||
- '**.md'
|
- '**.md'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 30 3 * * *
|
- cron: 30 3 * * *
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup-pypy:
|
setup-pypy:
|
||||||
@ -20,242 +18,30 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest]
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
pypy:
|
pypy:
|
||||||
- 'pypy-2.7'
|
- 'pypy-2.7'
|
||||||
- 'pypy-3.10'
|
- 'pypy-3.6'
|
||||||
- 'pypy3.9'
|
- 'pypy-3.7'
|
||||||
- 'pypy-2.7-v7.3.17'
|
- 'pypy-2.7-v7.3.2'
|
||||||
- 'pypy-3.10-v7.3.17'
|
- 'pypy-3.6-v7.3.2'
|
||||||
- 'pypy-3.10-v7.3.16'
|
- 'pypy-3.7-v7.3.2'
|
||||||
- 'pypy-3.10-v7.3.x'
|
- 'pypy-3.6-v7.3.x'
|
||||||
- 'pypy-3.10-v7.x'
|
- 'pypy-3.7-v7.x'
|
||||||
- 'pypy-2.7-v7.3.12rc1'
|
- 'pypy-2.7-v7.3.4rc1'
|
||||||
- 'pypy-3.10-nightly'
|
- 'pypy-3.7-nightly'
|
||||||
- 'pypy3.10-v7.3.17'
|
|
||||||
- 'pypy3.11-v7.3.19'
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.pypy }}
|
- name: setup-python ${{ matrix.pypy }}
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.pypy }}
|
python-version: ${{ matrix.pypy }}
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: PyPy and Python version
|
- name: PyPy and Python version
|
||||||
run: python --version
|
run: python --version
|
||||||
|
|
||||||
- name: Run simple code
|
- name: Run simple code
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
|
|
||||||
- name: Assert PyPy is running
|
|
||||||
run: |
|
|
||||||
import platform
|
|
||||||
assert platform.python_implementation().lower() == "pypy"
|
|
||||||
shell: python
|
|
||||||
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE=${{ matrix.pypy }}
|
|
||||||
EXECUTABLE=${EXECUTABLE/pypy-/pypy} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
|
|
||||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
check-non-eol:
|
|
||||||
name: Check non-eol ${{ matrix.pypy }} on ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- macos-13
|
|
||||||
- macos-14
|
|
||||||
- macos-15
|
|
||||||
- windows-2019
|
|
||||||
- windows-2022
|
|
||||||
- windows-2025
|
|
||||||
- ubuntu-22.04
|
|
||||||
- ubuntu-24.04
|
|
||||||
- ubuntu-22.04-arm
|
|
||||||
- ubuntu-24.04-arm
|
|
||||||
pypy: ['pypy-2.7', 'pypy-3.10', 'pypy-3.11']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.pypy }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.pypy }}
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: PyPy and Python version
|
|
||||||
run: python --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
- name: Assert PyPy is running
|
|
||||||
run: |
|
|
||||||
import platform
|
|
||||||
assert platform.python_implementation().lower() == "pypy"
|
|
||||||
shell: python
|
|
||||||
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE=${{ matrix.pypy }}
|
|
||||||
EXECUTABLE=${EXECUTABLE/pypy-/pypy} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
|
|
||||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-pypy-noenv:
|
|
||||||
name: Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
pypy: ['pypy2.7', 'pypy3.9', 'pypy3.10-nightly', 'pypy3.11']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.pypy }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.pypy }}
|
|
||||||
update-environment: false
|
|
||||||
|
|
||||||
- name: PyPy and Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
check-latest:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup PyPy and check latest
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 'pypy-3.11-v7.3.x'
|
|
||||||
check-latest: true
|
|
||||||
- name: PyPy and Python version
|
|
||||||
run: python --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
- name: Assert PyPy is running
|
|
||||||
run: |
|
|
||||||
import platform
|
|
||||||
assert platform.python_implementation().lower() == "pypy"
|
|
||||||
shell: python
|
|
||||||
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE="pypy-3.11-v7.3.x"
|
|
||||||
EXECUTABLE=${EXECUTABLE/-/} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
|
|
||||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-pypy-multiple-versions:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup PyPy and check latest
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: |
|
|
||||||
pypy-3.11-v7.3.x
|
|
||||||
pypy-3.10-v7.3.x
|
|
||||||
pypy3.9
|
|
||||||
check-latest: true
|
|
||||||
- name: PyPy and Python version
|
|
||||||
run: python --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
- name: Assert PyPy is running
|
|
||||||
run: |
|
|
||||||
import platform
|
|
||||||
assert platform.python_implementation().lower() == "pypy"
|
|
||||||
shell: python
|
|
||||||
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE="pypy-3.11-v7.3.x"
|
|
||||||
EXECUTABLE=${EXECUTABLE/-/} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
|
|
||||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
||||||
- name: Assert expected binaries (or symlinks) are present
|
|
||||||
run: |
|
|
||||||
EXECUTABLE='pypy3.9'
|
|
||||||
EXECUTABLE=${EXECUTABLE/pypy-/pypy} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
|
|
||||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
|
||||||
${EXECUTABLE} --version
|
|
||||||
shell: bash
|
|
||||||
|
486
.github/workflows/test-python-freethreaded.yml
vendored
486
.github/workflows/test-python-freethreaded.yml
vendored
@ -1,486 +0,0 @@
|
|||||||
name: Validate Python e2e freethread
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
schedule:
|
|
||||||
- cron: 30 3 * * *
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
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-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python }}
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-from-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} version file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: .python-version
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-from-file-without-parameter:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} version file without parameter
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-from-standard-pyproject-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} standard pyproject file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0, 3.13.1, 3.13.2]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: |
|
|
||||||
echo '[project]
|
|
||||||
requires-python = "${{ matrix.python }}"
|
|
||||||
' > pyproject.toml
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: pyproject.toml
|
|
||||||
freethreaded: true
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-from-poetry-pyproject-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0, 3.13.1, 3.13.2]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: |
|
|
||||||
echo '[tool.poetry.dependencies]
|
|
||||||
python = "${{ matrix.python }}"
|
|
||||||
' > pyproject.toml
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: pyproject.toml
|
|
||||||
freethreaded: true
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-from-tool-versions-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} .tool-versions file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-tool-versions-file ${{ matrix.python }}
|
|
||||||
run: |
|
|
||||||
echo "python ${{ matrix.python }}" > .tool-versions
|
|
||||||
|
|
||||||
- name: setup-python using .tool-versions ${{ matrix.python }}
|
|
||||||
id: setup-python-tool-versions
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: .tool-versions
|
|
||||||
|
|
||||||
setup-pre-release-version-from-manifest:
|
|
||||||
name: Setup 3.14.0-alpha.6 ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python 3.14.0-alpha.6
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: '3.14.0-alpha.6'
|
|
||||||
freethreaded: true
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-dev-version:
|
|
||||||
name: Setup 3.14t-dev ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python 3.14t-dev
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: '3.14t-dev'
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
|
||||||
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.14.') }}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-prerelease-version:
|
|
||||||
name: Setup 3.14t ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python 3.14t
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: '3.14t'
|
|
||||||
allow-prereleases: true
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
|
||||||
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.14.') }}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-noenv:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python }}
|
|
||||||
update-environment: false
|
|
||||||
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
check-latest:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: [3.13t, 3.14t-dev]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python and check latest
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
check-latest: true
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
setup-python-multiple-python-versions:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python and check latest
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: |
|
|
||||||
3.13.1t
|
|
||||||
3.13.2t
|
|
||||||
3.14t-dev
|
|
||||||
- name: Verify Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -VVV
|
|
||||||
|
|
||||||
setup-versions-with-freethread-input:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} using freethread input parameter
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-20.04,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.13.1, 3.13.2, 3.14-dev, 3.14.0-alpha.6]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python }}
|
|
||||||
freethreaded: true
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
- name: Validate GIL
|
|
||||||
run: python ./__tests__/verify-freethreaded.py
|
|
470
.github/workflows/test-python.yml
vendored
470
.github/workflows/test-python.yml
vendored
@ -1,5 +1,4 @@
|
|||||||
name: Validate Python e2e
|
name: Validate Python e2e
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@ -11,40 +10,45 @@ on:
|
|||||||
- '**.md'
|
- '**.md'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 30 3 * * *
|
- cron: 30 3 * * *
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
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, 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-versions-from-manifest:
|
setup-versions-from-manifest:
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }}
|
name: Setup ${{ matrix.python }} ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os: [macos-latest, windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
|
||||||
[
|
python: [3.5.4, 3.6.7, 3.7.5, 3.8.1]
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
- name: Validate version
|
||||||
run: |
|
run: |
|
||||||
$pythonVersion = (python --version)
|
$pythonVersion = (python --version)
|
||||||
@ -58,267 +62,27 @@ jobs:
|
|||||||
- name: Run simple code
|
- name: Run simple code
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
|
|
||||||
setup-versions-from-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} version file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: .python-version
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- 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))'
|
|
||||||
|
|
||||||
setup-versions-from-file-without-parameter:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} version file without parameter
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- 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))'
|
|
||||||
|
|
||||||
setup-versions-from-standard-pyproject-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} standard pyproject file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.9.13, 3.10.11, 3.11.9, '==3.12.3', 3.13.2]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: |
|
|
||||||
echo '[project]
|
|
||||||
requires-python = "${{ matrix.python }}"
|
|
||||||
' > pyproject.toml
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: pyproject.toml
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
|
||||||
run: |
|
|
||||||
$pythonVersion = (python --version)
|
|
||||||
if ("Python ${{ matrix.python }}".replace("==", "") -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))'
|
|
||||||
|
|
||||||
setup-versions-from-poetry-pyproject-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
|
||||||
run: |
|
|
||||||
echo '[tool.poetry.dependencies]
|
|
||||||
python = "${{ matrix.python }}"
|
|
||||||
' > pyproject.toml
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: pyproject.toml
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- 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))'
|
|
||||||
|
|
||||||
setup-versions-from-tool-versions-file:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} .tool-versions file
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: [pypy3.11-7.3.18, graalpy-24.1.2, 3.13.2, 3.14-dev]
|
|
||||||
exclude:
|
|
||||||
- os: windows-latest
|
|
||||||
python: graalpy-24.1.2
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build-tool-versions-file ${{ matrix.python }}
|
|
||||||
run: |
|
|
||||||
echo "python ${{ matrix.python }}" > .tool-versions
|
|
||||||
|
|
||||||
- name: setup-python using .tool-versions ${{ matrix.python }}
|
|
||||||
id: setup-python-tool-versions
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version-file: .tool-versions
|
|
||||||
|
|
||||||
setup-pre-release-version-from-manifest:
|
setup-pre-release-version-from-manifest:
|
||||||
name: Setup 3.14.0-alpha.6 ${{ matrix.os }}
|
name: Setup 3.9.0-beta.4 ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os: [macos-latest, windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: setup-python 3.14.0-alpha.6
|
- name: setup-python 3.9.0-beta.4
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: '3.14.0-alpha.6'
|
python-version: '3.9.0-beta.4'
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
- name: Validate version
|
||||||
run: |
|
run: |
|
||||||
$pythonVersion = (python --version)
|
$pythonVersion = (python --version)
|
||||||
if ("Python 3.14.0a6" -ne "$pythonVersion"){
|
if ("Python 3.9.0b4" -ne "$pythonVersion"){
|
||||||
Write-Host "The current version is $pythonVersion; expected version is 3.14.0a6"
|
Write-Host "The current version is $pythonVersion; expected version is 3.9.0b4"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
$pythonVersion
|
$pythonVersion
|
||||||
@ -327,181 +91,23 @@ jobs:
|
|||||||
- name: Run simple code
|
- name: Run simple code
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
|
|
||||||
setup-dev-version:
|
setup-pypy-legacy:
|
||||||
name: Setup 3.14-dev ${{ matrix.os }}
|
name: Setup PyPy ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os: [macos-latest, windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: setup-python 3.14-dev
|
- name: setup-python pypy3
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: '3.14-dev'
|
python-version: 'pypy3'
|
||||||
|
|
||||||
- name: Check python-path
|
- name: setup-python pypy2
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
|
||||||
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.14.') }}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-prerelease-version:
|
|
||||||
name: Setup 3.14 ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python 3.14
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: '3.14'
|
python-version: 'pypy2'
|
||||||
allow-prereleases: true
|
|
||||||
|
|
||||||
- name: Check python-path
|
|
||||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Validate version
|
|
||||||
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.14.') }}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
setup-versions-noenv:
|
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
macos-13,
|
|
||||||
ubuntu-latest,
|
|
||||||
ubuntu-24.04-arm
|
|
||||||
]
|
|
||||||
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
|
||||||
id: setup-python
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python }}
|
|
||||||
update-environment: false
|
|
||||||
|
|
||||||
- name: Python version
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} --version
|
|
||||||
|
|
||||||
- name: Run simple code
|
|
||||||
run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))'
|
|
||||||
|
|
||||||
check-latest:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python and check latest
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
check-latest: true
|
|
||||||
- name: Validate version
|
|
||||||
run: |
|
|
||||||
$pythonVersion = (python --version)
|
|
||||||
if ("$pythonVersion" -NotMatch "${{ matrix.python-version }}"){
|
|
||||||
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python-version }}"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
$pythonVersion
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
setup-python-multiple-python-versions:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
[
|
|
||||||
macos-latest,
|
|
||||||
windows-latest,
|
|
||||||
ubuntu-22.04,
|
|
||||||
ubuntu-22.04-arm,
|
|
||||||
ubuntu-24.04-arm,
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-13
|
|
||||||
]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Python and check latest
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: |
|
|
||||||
3.9
|
|
||||||
3.10
|
|
||||||
3.11
|
|
||||||
3.12
|
|
||||||
3.13
|
|
||||||
check-latest: true
|
|
||||||
- name: Validate version
|
|
||||||
run: |
|
|
||||||
$pythonVersion = (python --version)
|
|
||||||
if ("$pythonVersion" -NotMatch "3.13"){
|
|
||||||
Write-Host "The current version is $pythonVersion; expected version is 3.13"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
$pythonVersion
|
|
||||||
shell: pwsh
|
|
||||||
|
11
.github/workflows/update-config-files.yml
vendored
11
.github/workflows/update-config-files.yml
vendored
@ -1,11 +0,0 @@
|
|||||||
name: Update configuration files
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 3 * * 0'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-update-configuration-files:
|
|
||||||
name: Update configuration files
|
|
||||||
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
|
|
90
.github/workflows/workflow.yml
vendored
Normal file
90
.github/workflows/workflow.yml
vendored
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
name: Main workflow
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
name: Run
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js 12.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
|
||||||
|
- name: npm install
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run format-check
|
||||||
|
|
||||||
|
- name: npm test
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
- name: Run with setup-python 2.7
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 2.7
|
||||||
|
- name: Verify 2.7
|
||||||
|
run: python __tests__/verify-python.py 2.7
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.5
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.5
|
||||||
|
- name: Verify 3.5
|
||||||
|
run: python __tests__/verify-python.py 3.5
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.6
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.6
|
||||||
|
- name: Verify 3.6
|
||||||
|
run: python __tests__/verify-python.py 3.6
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.7
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Verify 3.7
|
||||||
|
run: python __tests__/verify-python.py 3.7
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.8
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
- name: Verify 3.8
|
||||||
|
run: python __tests__/verify-python.py 3.8
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.7.5
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.7.5
|
||||||
|
- name: Verify 3.7.5
|
||||||
|
run: python __tests__/verify-python.py 3.7.5
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.6.7
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.6.7
|
||||||
|
- name: Verify 3.6.7
|
||||||
|
run: python __tests__/verify-python.py 3.6.7
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.8.1
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.8.1
|
||||||
|
- name: Verify 3.8.1
|
||||||
|
run: python __tests__/verify-python.py 3.8.1
|
@ -9,7 +9,6 @@ allowed:
|
|||||||
- mit
|
- mit
|
||||||
- cc0-1.0
|
- cc0-1.0
|
||||||
- unlicense
|
- unlicense
|
||||||
- 0bsd
|
|
||||||
|
|
||||||
reviewed:
|
reviewed:
|
||||||
npm:
|
npm:
|
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/core.dep.yml
generated
BIN
.licenses/npm/@actions/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/exec.dep.yml
generated
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/glob-0.1.2.dep.yml
generated
BIN
.licenses/npm/@actions/glob-0.1.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/glob-0.5.0.dep.yml
generated
BIN
.licenses/npm/@actions/glob-0.5.0.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/io.dep.yml
generated
BIN
.licenses/npm/@actions/io.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@fastify/busboy.dep.yml
generated
BIN
.licenses/npm/@fastify/busboy.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@iarna/toml.dep.yml
generated
BIN
.licenses/npm/@iarna/toml.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node.dep.yml
generated
BIN
.licenses/npm/@types/node.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/abort-controller.dep.yml
generated
BIN
.licenses/npm/abort-controller.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/asynckit.dep.yml
generated
BIN
.licenses/npm/asynckit.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/balanced-match.dep.yml
generated
BIN
.licenses/npm/balanced-match.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/brace-expansion.dep.yml
generated
BIN
.licenses/npm/brace-expansion.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/combined-stream.dep.yml
generated
BIN
.licenses/npm/combined-stream.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/concat-map.dep.yml
generated
BIN
.licenses/npm/concat-map.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/delayed-stream.dep.yml
generated
BIN
.licenses/npm/delayed-stream.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/event-target-shim.dep.yml
generated
BIN
.licenses/npm/event-target-shim.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/events.dep.yml
generated
BIN
.licenses/npm/events.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/form-data-2.5.1.dep.yml
generated
BIN
.licenses/npm/form-data-2.5.1.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/form-data-4.0.0.dep.yml
generated
BIN
.licenses/npm/form-data-4.0.0.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/lru-cache.dep.yml
generated
BIN
.licenses/npm/lru-cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/mime-db.dep.yml
generated
BIN
.licenses/npm/mime-db.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/mime-types.dep.yml
generated
BIN
.licenses/npm/mime-types.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/minimatch.dep.yml
generated
BIN
.licenses/npm/minimatch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
BIN
.licenses/npm/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/process.dep.yml
generated
BIN
.licenses/npm/process.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/sax.dep.yml
generated
BIN
.licenses/npm/sax.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/tr46.dep.yml
generated
BIN
.licenses/npm/tr46.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/typescript.dep.yml
generated
BIN
.licenses/npm/typescript.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/undici-types.dep.yml
generated
BIN
.licenses/npm/undici-types.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/undici.dep.yml
generated
BIN
.licenses/npm/undici.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/uuid-8.3.2.dep.yml
generated
BIN
.licenses/npm/uuid-8.3.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/whatwg-url.dep.yml
generated
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xml2js.dep.yml
generated
BIN
.licenses/npm/xml2js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/yallist.dep.yml
generated
BIN
.licenses/npm/yallist.dep.yml
generated
Binary file not shown.
@ -1,7 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!.github/
|
|
||||||
!src/
|
|
@ -1,11 +0,0 @@
|
|||||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
|
||||||
module.exports = {
|
|
||||||
printWidth: 80,
|
|
||||||
tabWidth: 2,
|
|
||||||
useTabs: false,
|
|
||||||
semi: true,
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'none',
|
|
||||||
bracketSpacing: false,
|
|
||||||
arrowParens: 'avoid'
|
|
||||||
};
|
|
11
.prettierrc.json
Normal file
11
.prettierrc.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 80,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"bracketSpacing": false,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"parser": "typescript"
|
||||||
|
}
|
@ -1,76 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
|
||||||
contributors and maintainers pledge to make participation in our project and
|
|
||||||
our community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
||||||
level of experience, education, socio-economic status, nationality, personal
|
|
||||||
appearance, race, religion, or sexual identity and orientation.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
|
||||||
include:
|
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
|
||||||
* Being respectful of differing viewpoints and experiences
|
|
||||||
* Gracefully accepting constructive criticism
|
|
||||||
* Focusing on what is best for the community
|
|
||||||
* Showing empathy towards other community members
|
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
||||||
advances
|
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or electronic
|
|
||||||
address, without explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Our Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable
|
|
||||||
behavior and are expected to take appropriate and fair corrective action in
|
|
||||||
response to any instances of unacceptable behavior.
|
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or
|
|
||||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
||||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
||||||
permanently any contributor for other behaviors that they deem inappropriate,
|
|
||||||
threatening, offensive, or harmful.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies within all project spaces, and it also applies when
|
|
||||||
an individual is representing the project or its community in public spaces.
|
|
||||||
Examples of representing a project or community include using an official
|
|
||||||
project e-mail address, posting via an official social media account, or acting
|
|
||||||
as an appointed representative at an online or offline event. Representation of
|
|
||||||
a project may be further defined and clarified by project maintainers.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported by contacting the project team at opensource+actions/setup-python@github.com. All
|
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
||||||
Further details of specific enforcement policies may be posted separately.
|
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
||||||
faith may face temporary or permanent repercussions as determined by other
|
|
||||||
members of the project's leadership.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
||||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see
|
|
||||||
https://www.contributor-covenant.org/faq
|
|
293
README.md
293
README.md
@ -1,127 +1,256 @@
|
|||||||
# setup-python
|
# setup-python V2
|
||||||
|
|
||||||
[](https://github.com/actions/setup-python/actions/workflows/basic-validation.yml)
|
<p align="left">
|
||||||
[](https://github.com/actions/setup-python/actions/workflows/test-python.yml)
|
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a>
|
||||||
[](https://github.com/actions/setup-python/actions/workflows/test-pypy.yml)
|
</p>
|
||||||
[](https://github.com/actions/setup-python/actions/workflows/e2e-cache.yml)
|
|
||||||
|
|
||||||
This action provides the following functionality for GitHub Actions users:
|
This action sets up a Python environment for use in actions by:
|
||||||
|
|
||||||
- Installing a version of Python or PyPy and (by default) adding it to the PATH
|
- optionally installing and adding to PATH a version of Python that is already installed in the tools cache.
|
||||||
- Optionally caching dependencies for pip, pipenv and poetry
|
- downloading, installing and adding to PATH an available version of Python from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)) if a specific version is not available in the tools cache.
|
||||||
- Registering problem matchers for error output
|
- failing if a specific version of Python is not preinstalled or available for download.
|
||||||
|
- registering problem matchers for error output.
|
||||||
|
|
||||||
## Basic usage
|
# What's new
|
||||||
|
|
||||||
|
- Ability to download, install and set up Python packages from `actions/python-versions` that do not come preinstalled on runners.
|
||||||
|
- Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed.
|
||||||
|
- Automatic setup and download of Python packages if using a self-hosted runner.
|
||||||
|
- Support for pre-release versions of Python.
|
||||||
|
- Support for installing any version of PyPy on-flight
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
See [action.yml](action.yml)
|
See [action.yml](action.yml)
|
||||||
|
|
||||||
**Python**
|
Basic:
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
|
||||||
|
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
```
|
```
|
||||||
|
|
||||||
**PyPy**
|
Matrix Testing:
|
||||||
```yaml
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [ '2.x', '3.x', 'pypy-2.7', 'pypy-3.6', 'pypy-3.7' ]
|
||||||
|
name: Python ${{ matrix.python-version }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v5
|
- name: Setup python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 'pypy3.10'
|
python-version: ${{ matrix.python-version }}
|
||||||
|
architecture: x64
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
```
|
```
|
||||||
|
|
||||||
**GraalPy**
|
Exclude a specific Python version:
|
||||||
```yaml
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
python-version: ['2.7', '3.6', '3.7', '3.8', 'pypy-2.7', 'pypy-3.6']
|
||||||
|
exclude:
|
||||||
|
- os: macos-latest
|
||||||
|
python-version: '3.8'
|
||||||
|
- os: windows-latest
|
||||||
|
python-version: '3.6'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v5
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 'graalpy-24.0'
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Display Python version
|
||||||
|
run: python -c "import sys; print(sys.version)"
|
||||||
|
```
|
||||||
|
|
||||||
|
Download and set up a version of Python that does not come preinstalled on an image:
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded
|
||||||
|
python-version: ['3.5', '3.6', '3.7.4', '3.8']
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
```
|
```
|
||||||
|
|
||||||
**Free threaded Python**
|
Download and set up an accurate pre-release version of Python:
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.13t'
|
python-version: '3.9.0-beta.4'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
```
|
```
|
||||||
|
|
||||||
The `python-version` input is optional. If not supplied, the action will try to resolve the version from the default `.python-version` file. If the `.python-version` file doesn't exist Python or PyPy version from the PATH will be used. The default version of Python or PyPy in PATH varies between runners and can be changed unexpectedly so we recommend always setting Python version explicitly using the `python-version` or `python-version-file` inputs.
|
Download and set up the latest available version of Python (includes both pre-release and stable versions):
|
||||||
|
|
||||||
The action will first check the local [tool cache](docs/advanced-usage.md#hosted-tool-cache) for a [semver](https://github.com/npm/node-semver#versions) match. If unable to find a specific version in the tool cache, the action will attempt to download a version of Python from [GitHub Releases](https://github.com/actions/python-versions/releases) and for PyPy from the official [PyPy's dist](https://downloads.python.org/pypy/).
|
|
||||||
|
|
||||||
For information regarding locally cached versions of Python or PyPy on GitHub hosted runners, check out [GitHub Actions Runner Images](https://github.com/actions/runner-images).
|
|
||||||
|
|
||||||
## Supported version syntax
|
|
||||||
|
|
||||||
The `python-version` input supports the [Semantic Versioning Specification](https://semver.org/) and some special version notations (e.g. `semver ranges`, `x.y-dev syntax`, etc.), for detailed examples please refer to the section: [Using python-version input](docs/advanced-usage.md#using-the-python-version-input) of the [Advanced usage](docs/advanced-usage.md) guide.
|
|
||||||
|
|
||||||
## Supported architectures
|
|
||||||
|
|
||||||
Using the `architecture` input, it is possible to specify the required Python or PyPy interpreter architecture: `x86`, `x64`, or `arm64`. If the input is not specified, the architecture defaults to the host OS architecture.
|
|
||||||
|
|
||||||
## Caching packages dependencies
|
|
||||||
|
|
||||||
The action has built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default.
|
|
||||||
|
|
||||||
The action defaults to searching for a dependency file (`requirements.txt` or `pyproject.toml` for pip, `Pipfile.lock` for pipenv or `poetry.lock` for poetry) in the repository, and uses its hash as a part of the cache key. Input `cache-dependency-path` is used for cases when multiple dependency files are used, they are located in different subdirectories or different files for the hash that want to be used.
|
|
||||||
|
|
||||||
- For `pip`, the action will cache the global cache directory
|
|
||||||
- For `pipenv`, the action will cache virtualenv directory
|
|
||||||
- For `poetry`, the action will cache virtualenv directories -- one for each poetry project found
|
|
||||||
|
|
||||||
**Caching pip dependencies:**
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.9.0-alpha - 3.9.0' # SemVer's version range syntax
|
||||||
cache: 'pip' # caching pip dependencies
|
- run: python my_script.py
|
||||||
- run: pip install -r requirements.txt
|
|
||||||
```
|
```
|
||||||
>**Note:** Restored cache will not be used if the requirements.txt file is not updated for a long time and a newer version of the dependency is available which can lead to an increase in total build time.
|
|
||||||
|
|
||||||
>The requirements file format allows for specifying dependency versions using logical operators (for example chardet>=3.0.4) or specifying dependencies without any versions. In this case the pip install -r requirements.txt command will always try to install the latest available package version. To be sure that the cache will be used, please stick to a specific dependency version and update it manually if necessary.
|
Download and set up PyPy:
|
||||||
|
|
||||||
See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poetry` in the section: [Caching packages](docs/advanced-usage.md#caching-packages) of the [Advanced usage](docs/advanced-usage.md) guide.
|
|
||||||
|
|
||||||
## Advanced usage
|
|
||||||
|
|
||||||
- [Using the python-version input](docs/advanced-usage.md#using-the-python-version-input)
|
|
||||||
- [Using the python-version-file input](docs/advanced-usage.md#using-the-python-version-file-input)
|
|
||||||
- [Check latest version](docs/advanced-usage.md#check-latest-version)
|
|
||||||
- [Caching packages](docs/advanced-usage.md#caching-packages)
|
|
||||||
- [Outputs and environment variables](docs/advanced-usage.md#outputs-and-environment-variables)
|
|
||||||
- [Available versions of Python, PyPy and GraalPy](docs/advanced-usage.md#available-versions-of-python-pypy-and-graalpy)
|
|
||||||
- [Hosted tool cache](docs/advanced-usage.md#hosted-tool-cache)
|
|
||||||
- [Using `setup-python` with a self-hosted runner](docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner)
|
|
||||||
- [Using `setup-python` on GHES](docs/advanced-usage.md#using-setup-python-on-ghes)
|
|
||||||
- [Allow pre-releases](docs/advanced-usage.md#allow-pre-releases)
|
|
||||||
|
|
||||||
## Recommended permissions
|
|
||||||
|
|
||||||
When using the `setup-python` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
permissions:
|
jobs:
|
||||||
contents: read # access to check out code and install dependencies
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version:
|
||||||
|
- 'pypy-3.6' # the latest available version of PyPy that supports Python 3.6
|
||||||
|
- 'pypy-3.7' # the latest available version of PyPy that supports Python 3.7
|
||||||
|
- 'pypy-3.7-v7.3.3' # Python 3.7 and PyPy 7.3.3
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- run: python my_script.py
|
||||||
|
```
|
||||||
|
More details on PyPy syntax and examples of using preview / nightly versions of PyPy can be found in the [Available versions of PyPy](#available-versions-of-pypy) section.
|
||||||
|
|
||||||
|
# Getting started with Python + Actions
|
||||||
|
|
||||||
|
Check out our detailed guide on using [Python with GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-python-with-github-actions).
|
||||||
|
|
||||||
|
# Available versions of Python
|
||||||
|
|
||||||
|
`setup-python` is able to configure Python from two sources:
|
||||||
|
|
||||||
|
- Preinstalled versions of Python in the tools cache on GitHub-hosted runners.
|
||||||
|
- For detailed information regarding the available versions of Python that are installed see [Supported software](https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-software).
|
||||||
|
- For every minor version of Python, expect only the latest patch to be preinstalled.
|
||||||
|
- If `3.8.1` is installed for example, and `3.8.2` is released, expect `3.8.1` to be removed and replaced by `3.8.2` in the tools cache.
|
||||||
|
- If the exact patch version doesn't matter to you, specifying just the major and minor version will get you the latest preinstalled patch version. In the previous example, the version spec `3.8` will use the `3.8.2` Python version found in the cache.
|
||||||
|
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)).
|
||||||
|
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
|
||||||
|
- If there is a specific version of Python that is not available, you can open an issue here
|
||||||
|
|
||||||
|
# Available versions of PyPy
|
||||||
|
|
||||||
|
`setup-python` is able to configure PyPy from two sources:
|
||||||
|
|
||||||
|
- Preinstalled versions of PyPy in the tools cache on GitHub-hosted runners
|
||||||
|
- For detailed information regarding the available versions of PyPy that are installed see [Supported software](https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-software).
|
||||||
|
- For the latest PyPy release, all versions of Python are cached.
|
||||||
|
- Cache is updated with a 1-2 week delay. If you specify the PyPy version as `pypy-3.6`, the cached version will be used although a newer version is available. If you need to start using the recently released version right after release, you should specify the exact PyPy version using `pypy-3.6-v7.3.3`.
|
||||||
|
|
||||||
|
- Downloadable PyPy versions from the [official PyPy site](https://downloads.python.org/pypy/).
|
||||||
|
- All available versions that we can download are listed in [versions.json](https://downloads.python.org/pypy/versions.json) file.
|
||||||
|
- PyPy < 7.3.3 are not available to install on-flight.
|
||||||
|
- If some versions are not available, you can open an issue in https://foss.heptapod.net/pypy/pypy/
|
||||||
|
|
||||||
|
# Hosted Tool Cache
|
||||||
|
|
||||||
|
GitHub hosted runners have a tools cache that comes with a few versions of Python + PyPy already installed. This tools cache helps speed up runs and tool setup by not requiring any new downloads. There is an environment variable called `RUNNER_TOOL_CACHE` on each runner that describes the location of this tools cache and there is where you will find Python and PyPy installed. `setup-python` works by taking a specific version of Python or PyPy in this tools cache and adding it to PATH.
|
||||||
|
|
||||||
|
|| Location |
|
||||||
|
|------|-------|
|
||||||
|
|**Tool Cache Directory** |`RUNNER_TOOL_CACHE`|
|
||||||
|
|**Python Tool Cache**|`RUNNER_TOOL_CACHE/Python/*`|
|
||||||
|
|**PyPy Tool Cache**|`RUNNER_TOOL_CACHE/PyPy/*`|
|
||||||
|
|
||||||
|
GitHub virtual environments are setup in [actions/virtual-environments](https://github.com/actions/virtual-environments). During the setup, the available versions of Python and PyPy are automatically downloaded, setup and documented.
|
||||||
|
- [Tools cache setup for Ubuntu](https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/hosted-tool-cache.sh)
|
||||||
|
- [Tools cache setup for Windows](https://github.com/actions/virtual-environments/blob/main/images/win/scripts/Installers/Download-ToolCache.ps1)
|
||||||
|
|
||||||
|
# Specifying a Python version
|
||||||
|
|
||||||
|
If there is a specific version of Python that you need and you don't want to worry about any potential breaking changes due to patch updates (going from `3.7.5` to `3.7.6` for example), you should specify the exact major, minor, and patch version (such as `3.7.5`)
|
||||||
|
- The only downside to this is that set up will take a little longer since the exact version will have to be downloaded if the exact version is not already installed on the runner due to more recent versions.
|
||||||
|
- MSI installers are used on Windows for this, so runs will take a little longer to set up vs Mac and Linux.
|
||||||
|
|
||||||
|
You should specify only a major and minor version if you are okay with the most recent patch version being used.
|
||||||
|
- There will be a single patch version already installed on each runner for every minor version of Python that is supported.
|
||||||
|
- The patch version that will be preinstalled, will generally be the latest and every time there is a new patch released, the older version that is preinstalled will be replaced.
|
||||||
|
- Using the most recent patch version will result in a very quick setup since no downloads will be required since a locally installed version Python on the runner will be used.
|
||||||
|
|
||||||
|
# Specifying a PyPy version
|
||||||
|
The version of PyPy should be specified in the format `pypy-<python_version>[-v<pypy_version>]`.
|
||||||
|
The `<pypy_version>` parameter is optional and can be skipped. The latest version will be used in this case.
|
||||||
|
|
||||||
|
```
|
||||||
|
pypy-3.6 # the latest available version of PyPy that supports Python 3.6
|
||||||
|
pypy-3.7 # the latest available version of PyPy that supports Python 3.7
|
||||||
|
pypy-2.7 # the latest available version of PyPy that supports Python 2.7
|
||||||
|
pypy-3.7-v7.3.3 # Python 3.7 and PyPy 7.3.3
|
||||||
|
pypy-3.7-v7.x # Python 3.7 and the latest available PyPy 7.x
|
||||||
|
pypy-3.7-v7.3.3rc1 # Python 3.7 and preview version of PyPy
|
||||||
|
pypy-3.7-nightly # Python 3.7 and nightly PyPy
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
# Using `setup-python` with a self hosted runner
|
||||||
|
|
||||||
|
Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or another Linux distribution such as Fedora, `setup-python` will not work. If you have a supported self-hosted runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner.
|
||||||
|
|
||||||
|
If you are experiencing problems while configuring Python on your self-hosted runner, turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs.
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
- Your runner needs to be running with administrator privileges so that the appropriate directories and files can be set up when downloading and installing a new version of Python for the first time.
|
||||||
|
- If your runner is configured as a service, make sure the account that is running the service has the appropriate write permissions so that Python can get installed. The default `NT AUTHORITY\NETWORK SERVICE` should be sufficient.
|
||||||
|
- You need `7zip` installed and added to your `PATH` so that the downloaded versions of Python files can be extracted properly during first-time setup.
|
||||||
|
- MSI installers are used when setting up Python on Windows. A word of caution as MSI installers update registry settings.
|
||||||
|
- The 3.8 MSI installer for Windows will not let you install another 3.8 version of Python. If `setup-python` fails for a 3.8 version of Python, make sure any previously installed versions are removed by going to "Apps & Features" in the Settings app.
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
- The Python packages that are downloaded from `actions/python-versions` are originally compiled from source in `/opt/hostedtoolcache/` with the [--enable-shared](https://github.com/actions/python-versions/blob/94f04ae6806c6633c82db94c6406a16e17decd5c/builders/ubuntu-python-builder.psm1#L35) flag, which makes them non-relocatable.
|
||||||
|
- Create an environment variable called `AGENT_TOOLSDIRECTORY` and set it to `/opt/hostedtoolcache`. This controls where the runner downloads and installs tools.
|
||||||
|
- In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`.
|
||||||
|
- A more permanent way of setting the environment variable is to create a `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`. This ensures the variable is always set if your runner is configured as a service.
|
||||||
|
- Create a directory called `hostedtoolcache` inside `/opt`.
|
||||||
|
- The user starting the runner must have write permission to the `/opt/hostedtoolcache` directory. It is not possible to start the Linux runner with `sudo` and the `/opt` directory usually requires root privileges to write to. Check the current user and group that the runner belongs to by typing `ls -l` inside the runners root directory.
|
||||||
|
- The runner can be granted write access to the `/opt/hostedtoolcache` directory using a few techniques:
|
||||||
|
- The user starting the runner is the owner, and the owner has write permission.
|
||||||
|
- The user starting the runner is in the owning group, and the owning group has write permission.
|
||||||
|
- All users have write permission.
|
||||||
|
- One quick way to grant access is to change the user and group of `/opt/hostedtoolcache` to be the same as the runners using `chown`.
|
||||||
|
- `sudo chown runner-user:runner-group opt/hostedtoolcache/`.
|
||||||
|
- If your runner is configured as a service and you run into problems, make sure the user that the service is running as is correct. For more information, you can [check the status of your self-hosted runner](https://help.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service#checking-the-status-of-the-service).
|
||||||
|
|
||||||
|
### Mac
|
||||||
|
|
||||||
|
- The same setup that applies to `Linux` also applies to `Mac`, just with a different tools cache directory.
|
||||||
|
- Create a directory called `/Users/runner/hostedtoolcache`.
|
||||||
|
- Set the `AGENT_TOOLSDIRECTORY` environment variable to `/Users/runner/hostedtoolcache`.
|
||||||
|
- Change the permissions of `/Users/runner/hostedtoolcache` so that the runner has write access.
|
||||||
|
|
||||||
|
|
||||||
|
# Using Python without `setup-python`
|
||||||
|
|
||||||
|
`setup-python` helps keep your dependencies explicit and ensures consistent behavior between different runners. If you use `python` in a shell on a GitHub hosted runner without `setup-python` it will default to whatever is in PATH. The default version of Python in PATH vary between runners and can change unexpectedly so we recommend you always use `setup-python`.
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE).
|
The scripts and documentation in this project are released under the [MIT License](LICENSE).
|
||||||
|
|
||||||
## Contributions
|
# Contributions
|
||||||
|
|
||||||
Contributions are welcome! See our [Contributor's Guide](docs/contributors.md).
|
Contributions are welcome! See our [Contributor's Guide](docs/contributors.md).
|
||||||
|
@ -1,360 +0,0 @@
|
|||||||
import * as path from 'path';
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as cache from '@actions/cache';
|
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import * as io from '@actions/io';
|
|
||||||
import {getCacheDistributor} from '../src/cache-distributions/cache-factory';
|
|
||||||
import {State} from '../src/cache-distributions/cache-distributor';
|
|
||||||
|
|
||||||
describe('restore-cache', () => {
|
|
||||||
const pipFileLockHash =
|
|
||||||
'f8428d7cf00ea53a5c3702f0a9cb3cc467f76cd86a34723009350c4e4b32751a';
|
|
||||||
const requirementsHash =
|
|
||||||
'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121';
|
|
||||||
const requirementsLinuxHash =
|
|
||||||
'2d0ff7f46b0e120e3d3294db65768b474934242637b9899b873e6283dfd16d7c';
|
|
||||||
const poetryLockHash =
|
|
||||||
'f24ea1ad73968e6c8d80c16a093ade72d9332c433aeef979a0dd943e6a99b2ab';
|
|
||||||
const poetryConfigOutput = `
|
|
||||||
cache-dir = "/Users/patrick/Library/Caches/pypoetry"
|
|
||||||
experimental.new-installer = false
|
|
||||||
installer.parallel = true
|
|
||||||
virtualenvs.create = true
|
|
||||||
virtualenvs.in-project = true
|
|
||||||
virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/pypoetry/virtualenvs
|
|
||||||
`;
|
|
||||||
|
|
||||||
// core spy
|
|
||||||
let infoSpy: jest.SpyInstance;
|
|
||||||
let warningSpy: jest.SpyInstance;
|
|
||||||
let debugSpy: jest.SpyInstance;
|
|
||||||
let saveStateSpy: jest.SpyInstance;
|
|
||||||
let getStateSpy: jest.SpyInstance;
|
|
||||||
let setOutputSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
// cache spy
|
|
||||||
let restoreCacheSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
// exec spy
|
|
||||||
let getExecOutputSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
// io spy
|
|
||||||
let whichSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
process.env['RUNNER_OS'] = process.env['RUNNER_OS'] ?? 'linux';
|
|
||||||
|
|
||||||
infoSpy = jest.spyOn(core, 'info');
|
|
||||||
infoSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
warningSpy = jest.spyOn(core, 'warning');
|
|
||||||
warningSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
debugSpy = jest.spyOn(core, 'debug');
|
|
||||||
debugSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
saveStateSpy = jest.spyOn(core, 'saveState');
|
|
||||||
saveStateSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
getStateSpy = jest.spyOn(core, 'getState');
|
|
||||||
getStateSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
getExecOutputSpy = jest.spyOn(exec, 'getExecOutput');
|
|
||||||
getExecOutputSpy.mockImplementation((input: string) => {
|
|
||||||
if (input.includes('pip')) {
|
|
||||||
return {stdout: 'pip', stderr: '', exitCode: 0};
|
|
||||||
}
|
|
||||||
if (input.includes('poetry')) {
|
|
||||||
return {stdout: poetryConfigOutput, stderr: '', exitCode: 0};
|
|
||||||
}
|
|
||||||
if (input.includes('lsb_release')) {
|
|
||||||
return {stdout: 'Ubuntu\n20.04', stderr: '', exitCode: 0};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {stdout: '', stderr: 'Error occured', exitCode: 2};
|
|
||||||
});
|
|
||||||
|
|
||||||
setOutputSpy = jest.spyOn(core, 'setOutput');
|
|
||||||
setOutputSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
restoreCacheSpy = jest.spyOn(cache, 'restoreCache');
|
|
||||||
restoreCacheSpy.mockImplementation(
|
|
||||||
(cachePaths: string[], primaryKey: string, restoreKey?: string) => {
|
|
||||||
return primaryKey;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
whichSpy = jest.spyOn(io, 'which');
|
|
||||||
whichSpy.mockImplementation(() => '/path/to/python');
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Validate provided package manager', () => {
|
|
||||||
it.each(['npm', 'pip2', 'pip21', 'pip21.3', 'pipenv32'])(
|
|
||||||
'Throw an error because %s is not supported',
|
|
||||||
async packageManager => {
|
|
||||||
expect(() =>
|
|
||||||
getCacheDistributor(packageManager, '3.8.12', undefined)
|
|
||||||
).toThrow(`Caching for '${packageManager}' is not supported`);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Restore dependencies', () => {
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
'3.8.12',
|
|
||||||
'__tests__/data/**/requirements.txt',
|
|
||||||
requirementsHash,
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
'3.8.12',
|
|
||||||
'__tests__/data/**/requirements-linux.txt',
|
|
||||||
requirementsLinuxHash,
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
'3.8.12',
|
|
||||||
'__tests__/data/requirements-linux.txt',
|
|
||||||
requirementsLinuxHash,
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
'3.8.12',
|
|
||||||
'__tests__/data/requirements.txt',
|
|
||||||
requirementsHash,
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'pipenv',
|
|
||||||
'3.9.1',
|
|
||||||
'__tests__/data/**/Pipfile.lock',
|
|
||||||
pipFileLockHash,
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'pipenv',
|
|
||||||
'3.9.12',
|
|
||||||
'__tests__/data/requirements.txt',
|
|
||||||
requirementsHash,
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'poetry',
|
|
||||||
'3.9.1',
|
|
||||||
'__tests__/data/**/poetry.lock',
|
|
||||||
poetryLockHash,
|
|
||||||
[
|
|
||||||
'/Users/patrick/Library/Caches/pypoetry/virtualenvs',
|
|
||||||
path.join(__dirname, 'data', 'inner', '.venv'),
|
|
||||||
path.join(__dirname, 'data', '.venv')
|
|
||||||
]
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'restored dependencies for %s by primaryKey',
|
|
||||||
async (
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile,
|
|
||||||
fileHash,
|
|
||||||
cachePaths
|
|
||||||
) => {
|
|
||||||
restoreCacheSpy.mockImplementation(
|
|
||||||
(cachePaths: string[], primaryKey: string, restoreKey?: string) => {
|
|
||||||
return primaryKey.includes(fileHash) ? primaryKey : '';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile
|
|
||||||
);
|
|
||||||
|
|
||||||
await cacheDistributor.restoreCache();
|
|
||||||
|
|
||||||
if (cachePaths !== undefined) {
|
|
||||||
expect(saveStateSpy).toHaveBeenCalledWith(
|
|
||||||
State.CACHE_PATHS,
|
|
||||||
cachePaths
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const restoredKeys = restoreCacheSpy.mock.results.map(
|
|
||||||
result => result.value
|
|
||||||
);
|
|
||||||
|
|
||||||
restoredKeys.forEach(restoredKey => {
|
|
||||||
if (restoredKey) {
|
|
||||||
if (process.platform === 'linux' && packageManager === 'pip') {
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}-20.04-Ubuntu-python-${pythonVersion}-${packageManager}-${fileHash}`
|
|
||||||
);
|
|
||||||
} else if (packageManager === 'poetry') {
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}-python-${pythonVersion}-${packageManager}-v2-${fileHash}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-${process.arch}-python-${pythonVersion}-${packageManager}-${fileHash}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`${packageManager} cache is not found`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
30000
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([['pipenv', '3.9.12', 'requirements.txt', 'requirements.txt']])(
|
|
||||||
'Should throw an error because dependency file is not found',
|
|
||||||
async (
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile,
|
|
||||||
cacheDependencyPath
|
|
||||||
) => {
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile
|
|
||||||
);
|
|
||||||
|
|
||||||
await expect(cacheDistributor.restoreCache()).rejects.toThrow(
|
|
||||||
`No file in ${process.cwd()} matched to [${cacheDependencyPath
|
|
||||||
.split('\n')
|
|
||||||
.join(',')}], make sure you have checked out the target repository`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['pip', '3.8.12', 'requirements-linux.txt'],
|
|
||||||
['pip', '3.8.12', 'requirements.txt']
|
|
||||||
])(
|
|
||||||
'Shouldn`t throw an error as there is a default file `pyproject.toml` to use when requirements.txt is not specified',
|
|
||||||
async (packageManager, pythonVersion, dependencyFile) => {
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile
|
|
||||||
);
|
|
||||||
await expect(cacheDistributor.restoreCache()).resolves.not.toThrow();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['pip', '3.8.12', 'requirements-linux.txt'],
|
|
||||||
['pip', '3.8.12', 'requirements.txt']
|
|
||||||
])(
|
|
||||||
'Should throw an error as there is no default file `pyproject.toml` to use when requirements.txt is not specified',
|
|
||||||
async (packageManager, pythonVersion, dependencyFile) => {
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile
|
|
||||||
) as any; // Widening PipCache | PipenvCache | PoetryCache type to any allow us to change private property on the cacheDistributor to test value: "**/pyprojecttest.toml"
|
|
||||||
|
|
||||||
cacheDistributor.cacheDependencyBackupPath = '**/pyprojecttest.toml';
|
|
||||||
|
|
||||||
await expect(cacheDistributor.restoreCache()).rejects.toThrow();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Dependencies changed', () => {
|
|
||||||
it.each([
|
|
||||||
['pip', '3.8.12', '__tests__/data/**/requirements.txt', pipFileLockHash],
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
'3.8.12',
|
|
||||||
'__tests__/data/**/requirements-linux.txt',
|
|
||||||
pipFileLockHash
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
'3.8.12',
|
|
||||||
'__tests__/data/requirements-linux.txt',
|
|
||||||
pipFileLockHash
|
|
||||||
],
|
|
||||||
['pip', '3.8.12', '__tests__/data/requirements.txt', pipFileLockHash],
|
|
||||||
['pipenv', '3.9.1', '__tests__/data/**/Pipfile.lock', requirementsHash],
|
|
||||||
['pipenv', '3.9.12', '__tests__/data/requirements.txt', requirementsHash],
|
|
||||||
['poetry', '3.9.1', '__tests__/data/**/poetry.lock', requirementsHash]
|
|
||||||
])(
|
|
||||||
'restored dependencies for %s by primaryKey',
|
|
||||||
async (packageManager, pythonVersion, dependencyFile, fileHash) => {
|
|
||||||
restoreCacheSpy.mockImplementation(
|
|
||||||
(cachePaths: string[], primaryKey: string, restoreKey?: string) => {
|
|
||||||
return primaryKey !== fileHash && restoreKey ? pipFileLockHash : '';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile
|
|
||||||
);
|
|
||||||
await cacheDistributor.restoreCache();
|
|
||||||
let result = '';
|
|
||||||
|
|
||||||
switch (packageManager) {
|
|
||||||
case 'pip':
|
|
||||||
result = `Cache restored from key: ${fileHash}`;
|
|
||||||
break;
|
|
||||||
case 'pipenv':
|
|
||||||
result = 'pipenv cache is not found';
|
|
||||||
break;
|
|
||||||
case 'poetry':
|
|
||||||
result = 'poetry cache is not found';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(result);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Check if handleMatchResult', () => {
|
|
||||||
it.each([
|
|
||||||
['pip', '3.8.12', 'requirements.txt', 'someKey', 'someKey', true],
|
|
||||||
['pipenv', '3.9.1', 'requirements.txt', 'someKey', 'someKey', true],
|
|
||||||
['poetry', '3.8.12', 'requirements.txt', 'someKey', 'someKey', true],
|
|
||||||
['pip', '3.9.2', 'requirements.txt', undefined, 'someKey', false],
|
|
||||||
['pipenv', '3.8.12', 'requirements.txt', undefined, 'someKey', false],
|
|
||||||
['poetry', '3.9.12', 'requirements.txt', undefined, 'someKey', false]
|
|
||||||
])(
|
|
||||||
'sets correct outputs',
|
|
||||||
async (
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile,
|
|
||||||
matchedKey,
|
|
||||||
restoredKey,
|
|
||||||
expectedOutputValue
|
|
||||||
) => {
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
|
||||||
packageManager,
|
|
||||||
pythonVersion,
|
|
||||||
dependencyFile
|
|
||||||
);
|
|
||||||
cacheDistributor.handleMatchResult(matchedKey, restoredKey);
|
|
||||||
expect(setOutputSpy).toHaveBeenCalledWith(
|
|
||||||
'cache-hit',
|
|
||||||
expectedOutputValue
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,266 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as cache from '@actions/cache';
|
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import {run} from '../src/cache-save';
|
|
||||||
import {State} from '../src/cache-distributions/cache-distributor';
|
|
||||||
|
|
||||||
describe('run', () => {
|
|
||||||
const pipFileLockHash =
|
|
||||||
'd1dd6218299d8a6db5fc2001d988b34a8b31f1e9d0bb4534d377dde7c19f64b3';
|
|
||||||
const requirementsHash =
|
|
||||||
'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121';
|
|
||||||
const requirementsLinuxHash =
|
|
||||||
'2d0ff7f46b0e120e3d3294db65768b474934242637b9899b873e6283dfd16d7c';
|
|
||||||
const poetryLockHash =
|
|
||||||
'571bf984f8d210e6a97f854e479fdd4a2b5af67b5fdac109ec337a0ea16e7836';
|
|
||||||
|
|
||||||
// core spy
|
|
||||||
let infoSpy: jest.SpyInstance;
|
|
||||||
let warningSpy: jest.SpyInstance;
|
|
||||||
let debugSpy: jest.SpyInstance;
|
|
||||||
let saveStateSpy: jest.SpyInstance;
|
|
||||||
let getStateSpy: jest.SpyInstance;
|
|
||||||
let getInputSpy: jest.SpyInstance;
|
|
||||||
let setFailedSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
// cache spy
|
|
||||||
let saveCacheSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
// exec spy
|
|
||||||
let getExecOutputSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
let inputs = {} as any;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
process.env['RUNNER_OS'] = process.env['RUNNER_OS'] ?? 'linux';
|
|
||||||
|
|
||||||
infoSpy = jest.spyOn(core, 'info');
|
|
||||||
infoSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
warningSpy = jest.spyOn(core, 'warning');
|
|
||||||
warningSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
debugSpy = jest.spyOn(core, 'debug');
|
|
||||||
debugSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
saveStateSpy = jest.spyOn(core, 'saveState');
|
|
||||||
saveStateSpy.mockImplementation(input => undefined);
|
|
||||||
|
|
||||||
getStateSpy = jest.spyOn(core, 'getState');
|
|
||||||
getStateSpy.mockImplementation(input => {
|
|
||||||
if (input === State.CACHE_PATHS) {
|
|
||||||
return JSON.stringify([__dirname]);
|
|
||||||
}
|
|
||||||
return requirementsHash;
|
|
||||||
});
|
|
||||||
|
|
||||||
setFailedSpy = jest.spyOn(core, 'setFailed');
|
|
||||||
|
|
||||||
getInputSpy = jest.spyOn(core, 'getInput');
|
|
||||||
getInputSpy.mockImplementation(input => inputs[input]);
|
|
||||||
|
|
||||||
getExecOutputSpy = jest.spyOn(exec, 'getExecOutput');
|
|
||||||
getExecOutputSpy.mockImplementation((input: string) => {
|
|
||||||
if (input.includes('pip')) {
|
|
||||||
return {stdout: 'pip', stderr: '', exitCode: 0};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {stdout: '', stderr: 'Error occured', exitCode: 2};
|
|
||||||
});
|
|
||||||
|
|
||||||
saveCacheSpy = jest.spyOn(cache, 'saveCache');
|
|
||||||
saveCacheSpy.mockImplementation(() => undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Package manager validation', () => {
|
|
||||||
it('Package manager is not provided, skip caching', async () => {
|
|
||||||
inputs['cache'] = '';
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(infoSpy).not.toHaveBeenCalled();
|
|
||||||
expect(saveCacheSpy).not.toHaveBeenCalled();
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Validate unchanged cache is not saved', () => {
|
|
||||||
it('should not save cache for pip', async () => {
|
|
||||||
inputs['cache'] = 'pip';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(debugSpy).toHaveBeenCalledWith(
|
|
||||||
`paths for caching are ${__dirname}`
|
|
||||||
);
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`Cache hit occurred on the primary key ${requirementsHash}, not saving cache.`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not save cache for pipenv', async () => {
|
|
||||||
inputs['cache'] = 'pipenv';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(debugSpy).toHaveBeenCalledWith(
|
|
||||||
`paths for caching are ${__dirname}`
|
|
||||||
);
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`Cache hit occurred on the primary key ${requirementsHash}, not saving cache.`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('action saves the cache', () => {
|
|
||||||
it('saves cache from pip', async () => {
|
|
||||||
inputs['cache'] = 'pip';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
|
||||||
if (name === State.CACHE_MATCHED_KEY) {
|
|
||||||
return requirementsHash;
|
|
||||||
} else if (name === State.CACHE_PATHS) {
|
|
||||||
return JSON.stringify([__dirname]);
|
|
||||||
} else {
|
|
||||||
return pipFileLockHash;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).not.toHaveBeenCalledWith(
|
|
||||||
`Cache hit occurred on the primary key ${requirementsHash}, not saving cache.`
|
|
||||||
);
|
|
||||||
expect(saveCacheSpy).toHaveBeenCalled();
|
|
||||||
expect(infoSpy).toHaveBeenLastCalledWith(
|
|
||||||
`Cache saved with the key: ${pipFileLockHash}`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('saves cache from pipenv', async () => {
|
|
||||||
inputs['cache'] = 'pipenv';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
|
||||||
if (name === State.CACHE_MATCHED_KEY) {
|
|
||||||
return pipFileLockHash;
|
|
||||||
} else if (name === State.CACHE_PATHS) {
|
|
||||||
return JSON.stringify([__dirname]);
|
|
||||||
} else {
|
|
||||||
return requirementsHash;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).not.toHaveBeenCalledWith(
|
|
||||||
`Cache hit occurred on the primary key ${pipFileLockHash}, not saving cache.`
|
|
||||||
);
|
|
||||||
expect(saveCacheSpy).toHaveBeenCalled();
|
|
||||||
expect(infoSpy).toHaveBeenLastCalledWith(
|
|
||||||
`Cache saved with the key: ${requirementsHash}`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('saves cache from poetry', async () => {
|
|
||||||
inputs['cache'] = 'poetry';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
|
||||||
if (name === State.CACHE_MATCHED_KEY) {
|
|
||||||
return poetryLockHash;
|
|
||||||
} else if (name === State.CACHE_PATHS) {
|
|
||||||
return JSON.stringify([__dirname]);
|
|
||||||
} else {
|
|
||||||
return requirementsHash;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).not.toHaveBeenCalledWith(
|
|
||||||
`Cache hit occurred on the primary key ${poetryLockHash}, not saving cache.`
|
|
||||||
);
|
|
||||||
expect(saveCacheSpy).toHaveBeenCalled();
|
|
||||||
expect(infoSpy).toHaveBeenLastCalledWith(
|
|
||||||
`Cache saved with the key: ${requirementsHash}`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('saves with -1 cacheId , should not fail workflow', async () => {
|
|
||||||
inputs['cache'] = 'poetry';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
|
||||||
if (name === State.STATE_CACHE_PRIMARY_KEY) {
|
|
||||||
return poetryLockHash;
|
|
||||||
} else if (name === State.CACHE_PATHS) {
|
|
||||||
return JSON.stringify([__dirname]);
|
|
||||||
} else {
|
|
||||||
return requirementsHash;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
saveCacheSpy.mockImplementation(() => {
|
|
||||||
return -1;
|
|
||||||
});
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).not.toHaveBeenCalled();
|
|
||||||
expect(saveCacheSpy).toHaveBeenCalled();
|
|
||||||
expect(infoSpy).not.toHaveBeenLastCalledWith(
|
|
||||||
`Cache saved with the key: ${poetryLockHash}`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('saves with error from toolkit, should not fail the workflow', async () => {
|
|
||||||
inputs['cache'] = 'npm';
|
|
||||||
inputs['python-version'] = '3.10.0';
|
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
|
||||||
if (name === State.STATE_CACHE_PRIMARY_KEY) {
|
|
||||||
return poetryLockHash;
|
|
||||||
} else if (name === State.CACHE_PATHS) {
|
|
||||||
return JSON.stringify([__dirname]);
|
|
||||||
} else {
|
|
||||||
return requirementsHash;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
saveCacheSpy.mockImplementation(() => {
|
|
||||||
throw new cache.ValidationError('Validation failed');
|
|
||||||
});
|
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).not.toHaveBeenCalledWith();
|
|
||||||
expect(saveCacheSpy).toHaveBeenCalled();
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
inputs = {};
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
PYTHON_PATH="$1"
|
|
||||||
PATH_EXECUTABLE=$(python -c 'import sys; print(sys.executable)')
|
|
||||||
PYTHON_PATH_EXECUTABLE=$("${PYTHON_PATH}" -c 'import sys; print(sys.executable)')
|
|
||||||
if [ "${PATH_EXECUTABLE}" != "${PYTHON_PATH_EXECUTABLE}" ]; then
|
|
||||||
echo "Executable mismatch."
|
|
||||||
echo "python in PATH is: ${PATH_EXECUTABLE}"
|
|
||||||
echo "python-path (${PYTHON_PATH}) is: ${PYTHON_PATH_EXECUTABLE}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "python-path: ${PYTHON_PATH}"
|
|
@ -1,13 +0,0 @@
|
|||||||
[[source]]
|
|
||||||
url = "https://pypi.org/simple"
|
|
||||||
verify_ssl = true
|
|
||||||
name = "pypi"
|
|
||||||
|
|
||||||
[packages]
|
|
||||||
flake8 = "==6.0.0"
|
|
||||||
numpy = "==2.2.4"
|
|
||||||
|
|
||||||
[dev-packages]
|
|
||||||
|
|
||||||
[requires]
|
|
||||||
python_version = "*"
|
|
116
__tests__/data/Pipfile.lock
generated
116
__tests__/data/Pipfile.lock
generated
@ -1,116 +0,0 @@
|
|||||||
{
|
|
||||||
"_meta": {
|
|
||||||
"hash": {
|
|
||||||
"sha256": "9d0bc7ff1f9078396b19f05bc5cd57894f3783c68f96fa9d623b1ea5a1b168f5"
|
|
||||||
},
|
|
||||||
"pipfile-spec": 6,
|
|
||||||
"requires": {
|
|
||||||
"python_version": "*"
|
|
||||||
},
|
|
||||||
"sources": [
|
|
||||||
{
|
|
||||||
"name": "pypi",
|
|
||||||
"url": "https://pypi.org/simple",
|
|
||||||
"verify_ssl": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"default": {
|
|
||||||
"flake8": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:3833794e27ff64ea4e9cf5d410082a8b97ff1a06c16aa3d2027339cd0f1195c7",
|
|
||||||
"sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181"
|
|
||||||
],
|
|
||||||
"index": "pypi",
|
|
||||||
"markers": "python_full_version >= '3.8.1'",
|
|
||||||
"version": "==6.0.0"
|
|
||||||
},
|
|
||||||
"mccabe": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
|
|
||||||
"sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
|
|
||||||
],
|
|
||||||
"markers": "python_version >= '3.6'",
|
|
||||||
"version": "==0.7.0"
|
|
||||||
},
|
|
||||||
"numpy": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:05c076d531e9998e7e694c36e8b349969c56eadd2cdcd07242958489d79a7286",
|
|
||||||
"sha256:0d54974f9cf14acf49c60f0f7f4084b6579d24d439453d5fc5805d46a165b542",
|
|
||||||
"sha256:11c43995255eb4127115956495f43e9343736edb7fcdb0d973defd9de14cd84f",
|
|
||||||
"sha256:188dcbca89834cc2e14eb2f106c96d6d46f200fe0200310fc29089657379c58d",
|
|
||||||
"sha256:1974afec0b479e50438fc3648974268f972e2d908ddb6d7fb634598cdb8260a0",
|
|
||||||
"sha256:1cf4e5c6a278d620dee9ddeb487dc6a860f9b199eadeecc567f777daace1e9e7",
|
|
||||||
"sha256:207a2b8441cc8b6a2a78c9ddc64d00d20c303d79fba08c577752f080c4007ee3",
|
|
||||||
"sha256:218f061d2faa73621fa23d6359442b0fc658d5b9a70801373625d958259eaca3",
|
|
||||||
"sha256:2aad3c17ed2ff455b8eaafe06bcdae0062a1db77cb99f4b9cbb5f4ecb13c5146",
|
|
||||||
"sha256:2fa8fa7697ad1646b5c93de1719965844e004fcad23c91228aca1cf0800044a1",
|
|
||||||
"sha256:31504f970f563d99f71a3512d0c01a645b692b12a63630d6aafa0939e52361e6",
|
|
||||||
"sha256:3387dd7232804b341165cedcb90694565a6015433ee076c6754775e85d86f1fc",
|
|
||||||
"sha256:4ba5054787e89c59c593a4169830ab362ac2bee8a969249dc56e5d7d20ff8df9",
|
|
||||||
"sha256:4f92084defa704deadd4e0a5ab1dc52d8ac9e8a8ef617f3fbb853e79b0ea3592",
|
|
||||||
"sha256:65ef3468b53269eb5fdb3a5c09508c032b793da03251d5f8722b1194f1790c00",
|
|
||||||
"sha256:6f527d8fdb0286fd2fd97a2a96c6be17ba4232da346931d967a0630050dfd298",
|
|
||||||
"sha256:7051ee569db5fbac144335e0f3b9c2337e0c8d5c9fee015f259a5bd70772b7e8",
|
|
||||||
"sha256:7716e4a9b7af82c06a2543c53ca476fa0b57e4d760481273e09da04b74ee6ee2",
|
|
||||||
"sha256:79bd5f0a02aa16808fcbc79a9a376a147cc1045f7dfe44c6e7d53fa8b8a79392",
|
|
||||||
"sha256:7a4e84a6283b36632e2a5b56e121961f6542ab886bc9e12f8f9818b3c266bfbb",
|
|
||||||
"sha256:8120575cb4882318c791f839a4fd66161a6fa46f3f0a5e613071aae35b5dd8f8",
|
|
||||||
"sha256:81413336ef121a6ba746892fad881a83351ee3e1e4011f52e97fba79233611fd",
|
|
||||||
"sha256:8146f3550d627252269ac42ae660281d673eb6f8b32f113538e0cc2a9aed42b9",
|
|
||||||
"sha256:879cf3a9a2b53a4672a168c21375166171bc3932b7e21f622201811c43cdd3b0",
|
|
||||||
"sha256:892c10d6a73e0f14935c31229e03325a7b3093fafd6ce0af704be7f894d95687",
|
|
||||||
"sha256:92bda934a791c01d6d9d8e038363c50918ef7c40601552a58ac84c9613a665bc",
|
|
||||||
"sha256:9ba03692a45d3eef66559efe1d1096c4b9b75c0986b5dff5530c378fb8331d4f",
|
|
||||||
"sha256:9eeea959168ea555e556b8188da5fa7831e21d91ce031e95ce23747b7609f8a4",
|
|
||||||
"sha256:a0258ad1f44f138b791327961caedffbf9612bfa504ab9597157806faa95194a",
|
|
||||||
"sha256:a761ba0fa886a7bb33c6c8f6f20213735cb19642c580a931c625ee377ee8bd39",
|
|
||||||
"sha256:a7b9084668aa0f64e64bd00d27ba5146ef1c3a8835f3bd912e7a9e01326804c4",
|
|
||||||
"sha256:a84eda42bd12edc36eb5b53bbcc9b406820d3353f1994b6cfe453a33ff101775",
|
|
||||||
"sha256:ab2939cd5bec30a7430cbdb2287b63151b77cf9624de0532d629c9a1c59b1d5c",
|
|
||||||
"sha256:ac0280f1ba4a4bfff363a99a6aceed4f8e123f8a9b234c89140f5e894e452ecd",
|
|
||||||
"sha256:adf8c1d66f432ce577d0197dceaac2ac00c0759f573f28516246351c58a85020",
|
|
||||||
"sha256:b4adfbbc64014976d2f91084915ca4e626fbf2057fb81af209c1a6d776d23e3d",
|
|
||||||
"sha256:bb649f8b207ab07caebba230d851b579a3c8711a851d29efe15008e31bb4de24",
|
|
||||||
"sha256:bce43e386c16898b91e162e5baaad90c4b06f9dcbe36282490032cec98dc8ae7",
|
|
||||||
"sha256:bd3ad3b0a40e713fc68f99ecfd07124195333f1e689387c180813f0e94309d6f",
|
|
||||||
"sha256:c3f7ac96b16955634e223b579a3e5798df59007ca43e8d451a0e6a50f6bfdfba",
|
|
||||||
"sha256:cf28633d64294969c019c6df4ff37f5698e8326db68cc2b66576a51fad634880",
|
|
||||||
"sha256:d0f35b19894a9e08639fd60a1ec1978cb7f5f7f1eace62f38dd36be8aecdef4d",
|
|
||||||
"sha256:db1f1c22173ac1c58db249ae48aa7ead29f534b9a948bc56828337aa84a32ed6",
|
|
||||||
"sha256:dbe512c511956b893d2dacd007d955a3f03d555ae05cfa3ff1c1ff6df8851854",
|
|
||||||
"sha256:df2f57871a96bbc1b69733cd4c51dc33bea66146b8c63cacbfed73eec0883017",
|
|
||||||
"sha256:e2f085ce2e813a50dfd0e01fbfc0c12bbe5d2063d99f8b29da30e544fb6483b8",
|
|
||||||
"sha256:e642d86b8f956098b564a45e6f6ce68a22c2c97a04f5acd3f221f57b8cb850ae",
|
|
||||||
"sha256:e9e0a277bb2eb5d8a7407e14688b85fd8ad628ee4e0c7930415687b6564207a4",
|
|
||||||
"sha256:ea2bb7e2ae9e37d96835b3576a4fa4b3a97592fbea8ef7c3587078b0068b8f09",
|
|
||||||
"sha256:ee4d528022f4c5ff67332469e10efe06a267e32f4067dc76bb7e2cddf3cd25ff",
|
|
||||||
"sha256:f05d4198c1bacc9124018109c5fba2f3201dbe7ab6e92ff100494f236209c960",
|
|
||||||
"sha256:f34dc300df798742b3d06515aa2a0aee20941c13579d7a2f2e10af01ae4901ee",
|
|
||||||
"sha256:f4162988a360a29af158aeb4a2f4f09ffed6a969c9776f8f3bdee9b06a8ab7e5",
|
|
||||||
"sha256:f486038e44caa08dbd97275a9a35a283a8f1d2f0ee60ac260a1790e76660833c",
|
|
||||||
"sha256:f7de08cbe5551911886d1ab60de58448c6df0f67d9feb7d1fb21e9875ef95e91"
|
|
||||||
],
|
|
||||||
"index": "pypi",
|
|
||||||
"markers": "python_version >= '3.10'",
|
|
||||||
"version": "==2.2.4"
|
|
||||||
},
|
|
||||||
"pycodestyle": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053",
|
|
||||||
"sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610"
|
|
||||||
],
|
|
||||||
"markers": "python_version >= '3.6'",
|
|
||||||
"version": "==2.10.0"
|
|
||||||
},
|
|
||||||
"pyflakes": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf",
|
|
||||||
"sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd"
|
|
||||||
],
|
|
||||||
"markers": "python_version >= '3.6'",
|
|
||||||
"version": "==3.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"develop": {}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
1
__tests__/data/inner/poetry.lock
generated
1
__tests__/data/inner/poetry.lock
generated
@ -1 +0,0 @@
|
|||||||
../poetry.lock
|
|
@ -1 +0,0 @@
|
|||||||
../pyproject.toml
|
|
@ -1,2 +0,0 @@
|
|||||||
numpy==2.2.4
|
|
||||||
flake8==6.0.0
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user