diff --git a/.github/workflows/basic-validation.yml b/.github/workflows/basic-validation.yml deleted file mode 100644 index e3e4718cc..000000000 --- a/.github/workflows/basic-validation.yml +++ /dev/null @@ -1,15 +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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 2f49e971d..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: CodeQL analysis - -on: - push: - branches: ['main'] - pull_request: - schedule: - - cron: '0 3 * * 0' - -jobs: - call-codeQL-analysis: - name: CodeQL analysis - uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml deleted file mode 100644 index 876b60926..000000000 --- a/.github/workflows/e2e-cache.yml +++ /dev/null @@ -1,147 +0,0 @@ -name: e2e-cache - -on: - pull_request: - paths-ignore: - - '**.md' - push: - branches: - - main - - releases/* - paths-ignore: - - '**.md' - -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, windows-latest, macos-latest] - python-version: ['3.9', 'pypy-3.7-v7.x'] - steps: - - uses: actions/checkout@v3 - - 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, windows-latest, macos-latest] - python-version: ['3.9', 'pypy-3.9-v7.x'] - steps: - - uses: actions/checkout@v3 - - 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, windows-latest, macos-latest] - python-version: ['3.9', 'pypy-3.8'] - steps: - - uses: actions/checkout@v3 - - 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 - - python-pip-dependencies-caching-path: - name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.9', 'pypy-3.7-v7.x'] - steps: - - uses: actions/checkout@v3 - - 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 }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.9', 'pypy-3.9-v7.x'] - steps: - - uses: actions/checkout@v3 - - 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 diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 589a6f57f..fbcc9e7ac 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -21,55 +21,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - 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 - - name: Run with setup-python 3.10 id: cp310 uses: ./ @@ -83,13 +34,13 @@ jobs: - name: Run with setup-python ==3.8 uses: ./ with: - python-version: '==3.8' + python-version: '==3.10' - name: Verify ==3.8 - run: python __tests__/verify-python.py 3.8 + run: python __tests__/verify-python.py 3.10 - name: Run with setup-python <3.11 uses: ./ with: - python-version: '<3.11' + python-version: '3.11' - name: Verify <3.11 - run: python __tests__/verify-python.py 3.10 + run: python __tests__/verify-python.py 3.11 diff --git a/.github/workflows/test-graalpy.yml b/.github/workflows/test-graalpy.yml deleted file mode 100644 index c5ec1f8b8..000000000 --- a/.github/workflows/test-graalpy.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: Validate GraalPy e2e - -on: - push: - branches: - - main - paths-ignore: - - '**.md' - pull_request: - paths-ignore: - - '**.md' - -jobs: - setup-graalpy: - name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-20.04, ubuntu-latest] - graalpy: - - 'graalpy-23.0' - - 'graalpy-22.3' - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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-20.04, ubuntu-latest] - graalpy: ['graalpy23.0', 'graalpy22.3'] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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] - steps: - - uses: actions/checkout@v3 - - name: Setup GraalPy and check latest - uses: ./ - id: graalpy - with: - python-version: 'graalpy-23.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 diff --git a/.github/workflows/test-pypy.yml b/.github/workflows/test-pypy.yml deleted file mode 100644 index c88332d91..000000000 --- a/.github/workflows/test-pypy.yml +++ /dev/null @@ -1,169 +0,0 @@ -name: Validate PyPy e2e - -on: - push: - branches: - - main - paths-ignore: - - '**.md' - pull_request: - paths-ignore: - - '**.md' - schedule: - - cron: 30 3 * * * - -jobs: - setup-pypy: - name: Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-latest] - pypy: - - 'pypy-2.7' - - 'pypy-3.7' - - 'pypy3.9' - - 'pypy-2.7-v7.3.4' - - 'pypy-3.7-v7.3.5' - - 'pypy-3.7-v7.3.4' - - 'pypy-3.7-v7.3.x' - - 'pypy-3.7-v7.x' - - 'pypy-2.7-v7.3.4rc1' - - 'pypy-3.7-nightly' - - 'pypy3.8-v7.3.7' - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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-20.04, ubuntu-latest] - pypy: ['pypy2.7', 'pypy3.7', 'pypy3.8', 'pypy3.9-nightly'] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v3 - - name: Setup PyPy and check latest - uses: ./ - with: - python-version: 'pypy-3.7-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.7-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: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v3 - - name: Setup PyPy and check latest - uses: ./ - with: - python-version: | - pypy-3.7-v7.3.x - pypy3.8 - 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.7-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.8' - 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 diff --git a/action.yml b/action.yml index 3a6531c88..f4409356d 100644 --- a/action.yml +++ b/action.yml @@ -1,7 +1,7 @@ --- -name: "Setup Python" +name: "Setup Python FixedRunnerName" description: "Set up a specific version of Python and add the command-line tools to the PATH." -author: "GitHub" +author: "jonluca" inputs: python-version: description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset." @@ -34,7 +34,7 @@ outputs: python-path: description: "The absolute path to the Python or PyPy executable." runs: - using: 'node16' + using: 'node20' main: 'dist/setup/index.js' post: 'dist/cache-save/index.js' post-if: success() diff --git a/dist/setup/index.js b/dist/setup/index.js index 251a7685c..c0682250d 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -70341,7 +70341,7 @@ function run() { var _a; return __awaiter(this, void 0, void 0, function* () { if (utils_1.IS_MAC) { - process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + process.env['AGENT_TOOLSDIRECTORY'] = path.join(os.homedir(), 'hostedtoolcache'); } if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; diff --git a/jest.config.js b/jest.config.js index 563d4ccb8..c4970c684 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,5 +7,6 @@ module.exports = { transform: { '^.+\\.ts$': 'ts-jest' }, - verbose: true + verbose: true, + testTimeout: 15000 } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3c4ce9f70..cd02828d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "setup-python", - "version": "4.0.0", + "name": "setup-python-runner-name", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "setup-python", - "version": "4.0.0", + "name": "setup-python-runner-name", + "version": "1.0.0", "license": "MIT", "dependencies": { "@actions/cache": "^3.0.4", diff --git a/package.json b/package.json index 9efb3f425..e6fae4a18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "setup-python", - "version": "4.0.0", + "name": "setup-python-runner-name", + "version": "1.0.0", "private": true, "description": "Setup python action", "main": "dist/index.js", diff --git a/src/setup-python.ts b/src/setup-python.ts index 0dd45f0ca..3203e29d3 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -78,7 +78,10 @@ function resolveVersionInput() { async function run() { if (IS_MAC) { - process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + process.env['AGENT_TOOLSDIRECTORY'] = path.join( + os.homedir(), + 'hostedtoolcache' + ); } if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {