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/check-dist.yml b/.github/workflows/check-dist.yml deleted file mode 100644 index c95229131..000000000 --- a/.github/workflows/check-dist.yml +++ /dev/null @@ -1,17 +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 diff --git a/.github/workflows/code-deploy.yml b/.github/workflows/code-deploy.yml new file mode 100644 index 000000000..9c206c899 --- /dev/null +++ b/.github/workflows/code-deploy.yml @@ -0,0 +1,31 @@ +name: Deploy for CODE + +on: + push: + pull_request: + +jobs: + build-and-deploy: + runs-on: [ ubuntu-20.04 ] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 19.6.0 + + - name: Install packages + run: npm install + + - name: Build + run: npm run build + + - name: Deploy + if: ${{ github.ref == 'refs/heads/main' }} + run: | + git config --local user.name retzero + git config --local user.email ticce@naver.com + git add ./dist/ + git commit -m "[ci skip] dist/ update with ${GITHUB_SHA:0:7}" + git push origin 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 deleted file mode 100644 index 1f66c5b9e..000000000 --- a/.github/workflows/e2e-tests.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: e2e tests - -on: - push: - branches: - - main - paths-ignore: - - '**.md' - pull_request: - paths-ignore: - - '**.md' - -jobs: - test-setup-python: - name: Test setup-python - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: [ubuntu-20.04, windows-latest] - steps: - - 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: ./ - with: - python-version: '3.10' - - name: Verify 3.10 - run: python __tests__/verify-python.py 3.10 - - name: Run python-path sample 3.10 - run: pipx run --python '${{ steps.cp310.outputs.python-path }}' nox --version - - - 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.11 - uses: ./ - with: - python-version: '<3.11' - - name: Verify <3.11 - run: python __tests__/verify-python.py 3.10 - - - name: Run with setup-python >3.8 - uses: ./ - with: - python-version: '>3.8' - - name: Verify >3.8 - run: python __tests__/verify-python.py 3.11 diff --git a/.github/workflows/licensed.yml b/.github/workflows/licensed.yml deleted file mode 100644 index a00d7744a..000000000 --- a/.github/workflows/licensed.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Licensed - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - call-licensed: - name: Licensed - uses: actions/reusable-workflows/.github/workflows/licensed.yml@main diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml deleted file mode 100644 index d8171ef88..000000000 --- a/.github/workflows/release-new-action-version.yml +++ /dev/null @@ -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.2.2 - with: - source-tag: ${{ env.TAG_NAME }} - slack-webhook: ${{ secrets.SLACK_WEBHOOK }} 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/.github/workflows/test-python.yml b/.github/workflows/test-python.yml deleted file mode 100644 index 56f84796f..000000000 --- a/.github/workflows/test-python.yml +++ /dev/null @@ -1,418 +0,0 @@ -name: Validate Python e2e - -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] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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: 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: - 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] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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-20.04, ubuntu-22.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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-20.04, ubuntu-22.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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 }}" -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-20.04, ubuntu-22.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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-pre-release-version-from-manifest: - name: Setup 3.9.0-beta.4 ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-20.04] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: setup-python 3.9.0-beta.4 - id: setup-python - uses: ./ - with: - 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 - run: | - $pythonVersion = (python --version) - if ("Python 3.9.0b4" -ne "$pythonVersion"){ - Write-Host "The current version is $pythonVersion; expected version is 3.9.0b4" - exit 1 - } - $pythonVersion - shell: pwsh - - - name: Run simple code - run: python -c 'import math; print(math.factorial(5))' - - setup-dev-version: - name: Setup 3.9-dev ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: setup-python 3.9-dev - id: setup-python - uses: ./ - with: - python-version: '3.9-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.9.') }} - shell: bash - - - name: Run simple code - run: python -c 'import math; print(math.factorial(5))' - - setup-prerelease-version: - name: Setup 3.12 ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: setup-python 3.12 - id: setup-python - uses: ./ - with: - python-version: '3.12' - 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.12.') }} - 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] - python: ['3.7', '3.8', '3.9', '3.10'] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - 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: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.8', '3.9', '3.10'] - steps: - - uses: actions/checkout@v3 - - 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: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v3 - - name: Setup Python and check latest - uses: ./ - with: - python-version: | - 3.7 - 3.8 - 3.9 - 3.10 - check-latest: true - - name: Validate version - run: | - $pythonVersion = (python --version) - if ("$pythonVersion" -NotMatch "3.10"){ - Write-Host "The current version is $pythonVersion; expected version is 3.10" - exit 1 - } - $pythonVersion - shell: pwsh diff --git a/.github/workflows/update-config-files.yml b/.github/workflows/update-config-files.yml deleted file mode 100644 index 87af50042..000000000 --- a/.github/workflows/update-config-files.yml +++ /dev/null @@ -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 diff --git a/dist/setup/index.js b/dist/setup/index.js index 37b247905..5b1977a11 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -69679,13 +69679,14 @@ const path = __importStar(__nccwpck_require__(1017)); const core = __importStar(__nccwpck_require__(2186)); const tc = __importStar(__nccwpck_require__(7784)); const exec = __importStar(__nccwpck_require__(1514)); +const httpm = __importStar(__nccwpck_require__(9925)); const utils_1 = __nccwpck_require__(1314); const TOKEN = core.getInput('token'); const AUTH = !TOKEN ? undefined : `token ${TOKEN}`; const MANIFEST_REPO_OWNER = 'actions'; const MANIFEST_REPO_NAME = 'python-versions'; const MANIFEST_REPO_BRANCH = 'main'; -exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; +exports.MANIFEST_URL = `https://code-actions.github.io/python-versions/versions-manifest.json`; function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) { return __awaiter(this, void 0, void 0, function* () { if (!manifest) { @@ -69697,8 +69698,26 @@ function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) { } exports.findReleaseFromManifest = findReleaseFromManifest; function getManifest() { - core.debug(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`); - return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH); + return __awaiter(this, void 0, void 0, function* () { + core.debug(`Getting manifest from ${exports.MANIFEST_URL}`); + let releases = []; + const http = new httpm.HttpClient('tool-cache'); + const headers = {}; + headers['accept'] = 'application/json'; + let versionsRaw = ''; + versionsRaw = yield (yield http.get(exports.MANIFEST_URL, headers)).readBody(); + if (versionsRaw) { + // shouldn't be needed but protects against invalid json saved with BOM + versionsRaw = versionsRaw.replace(/^\uFEFF/, ''); + try { + releases = JSON.parse(versionsRaw); + } + catch (_a) { + core.debug('Invalid json'); + } + } + return releases; + }); } exports.getManifest = getManifest; function installPython(workingDirectory) { diff --git a/src/install-python.ts b/src/install-python.ts index 2af61291d..f5f0bff31 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -2,6 +2,8 @@ import * as path from 'path'; import * as core from '@actions/core'; import * as tc from '@actions/tool-cache'; import * as exec from '@actions/exec'; +import * as httpm from '@actions/http-client'; +import {OutgoingHttpHeaders} from 'http'; import {ExecOptions} from '@actions/exec/lib/interfaces'; import {IS_WINDOWS, IS_LINUX} from './utils'; @@ -10,7 +12,7 @@ const AUTH = !TOKEN ? undefined : `token ${TOKEN}`; const MANIFEST_REPO_OWNER = 'actions'; const MANIFEST_REPO_NAME = 'python-versions'; const MANIFEST_REPO_BRANCH = 'main'; -export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; +export const MANIFEST_URL = `https://code-actions.github.io/python-versions/versions-manifest.json`; export async function findReleaseFromManifest( semanticVersionSpec: string, @@ -31,16 +33,27 @@ export async function findReleaseFromManifest( return foundRelease; } -export function getManifest(): Promise { +export async function getManifest(): Promise { core.debug( - `Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}` - ); - return tc.getManifestFromRepo( - MANIFEST_REPO_OWNER, - MANIFEST_REPO_NAME, - AUTH, - MANIFEST_REPO_BRANCH + `Getting manifest from ${MANIFEST_URL}` ); + + let releases: tc.IToolRelease[] = [] + const http: httpm.HttpClient = new httpm.HttpClient('tool-cache') + const headers: OutgoingHttpHeaders = {} + headers['accept'] = 'application/json' + let versionsRaw = '' + versionsRaw = await (await http.get(MANIFEST_URL, headers)).readBody() + if (versionsRaw) { + // shouldn't be needed but protects against invalid json saved with BOM + versionsRaw = versionsRaw.replace(/^\uFEFF/, '') + try { + releases = JSON.parse(versionsRaw) + } catch { + core.debug('Invalid json') + } + } + return releases } async function installPython(workingDirectory: string) {