The requests module 1.2.3 is no longer compatible with python >=3.10.0. So, instead use 2.26.0, the most recent version that is compatible with our supported python versions at the time of this commit.
157 lines
4.9 KiB
YAML
157 lines
4.9 KiB
YAML
name: Test Python Package Installation on Linux and Mac
|
|
|
|
on:
|
|
push:
|
|
branches: [main, v1]
|
|
pull_request:
|
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
|
# by other workflows.
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
|
|
jobs:
|
|
test-setup-python-scripts:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
|
python_version: [2, 3]
|
|
|
|
env:
|
|
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
|
|
PYTHON_VERSION: ${{ matrix.python_version }}
|
|
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Initialize CodeQL
|
|
uses: ./init
|
|
id: init
|
|
with:
|
|
tools: latest
|
|
languages: python
|
|
setup-python-dependencies: false
|
|
|
|
- name: Test Auto Package Installation
|
|
run: |
|
|
set -x
|
|
$GITHUB_WORKSPACE/python-setup/install_tools.sh
|
|
|
|
cd $GITHUB_WORKSPACE/python-setup/tests/${PYTHON_DEPS_TYPE}/requests-${PYTHON_VERSION}
|
|
|
|
case ${{ matrix.os }} in
|
|
ubuntu-latest*) basePath="/opt";;
|
|
macos-latest*) basePath="/Users/runner";;
|
|
esac
|
|
echo ${basePath}
|
|
|
|
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
|
|
- name: Setup for extractor
|
|
run: |
|
|
echo $CODEQL_PYTHON
|
|
# only run if $CODEQL_PYTHON is set
|
|
if [ ! -z $CODEQL_PYTHON ]; then
|
|
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
|
|
fi
|
|
|
|
- name: Verify packages installed
|
|
run: |
|
|
$GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh ${PYTHON_VERSION}
|
|
|
|
# This one shouldn't fail, but also won't install packages
|
|
test-setup-python-scripts-non-standard-location:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Initialize CodeQL
|
|
uses: ./init
|
|
id: init
|
|
with:
|
|
tools: latest
|
|
languages: python
|
|
setup-python-dependencies: false
|
|
|
|
- name: Test Auto Package Installation
|
|
run: |
|
|
set -x
|
|
$GITHUB_WORKSPACE/python-setup/install_tools.sh
|
|
|
|
cd $GITHUB_WORKSPACE/python-setup/tests/requirements/non-standard-location
|
|
|
|
case ${{ matrix.os }} in
|
|
ubuntu-latest*) basePath="/opt";;
|
|
macos-latest*) basePath="/Users/runner";;
|
|
esac
|
|
echo ${basePath}
|
|
|
|
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
|
|
|
|
- name: Setup for extractor
|
|
run: |
|
|
echo $CODEQL_PYTHON
|
|
# only run if $CODEQL_PYTHON is set
|
|
if [ ! -z $CODEQL_PYTHON ]; then
|
|
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
|
|
fi
|
|
|
|
- name: Verify packages installed
|
|
run: |
|
|
test -z $LGTM_INDEX_IMPORT_PATH
|
|
|
|
test-setup-python-scripts-windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
|
python_version: [2, 3]
|
|
|
|
env:
|
|
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
|
|
PYTHON_VERSION: ${{ matrix.python_version }}
|
|
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Initialize CodeQL
|
|
uses: ./init
|
|
with:
|
|
tools: latest
|
|
languages: python
|
|
setup-python-dependencies: false
|
|
|
|
- name: Test Auto Package Installation
|
|
run: |
|
|
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
|
|
powershell -File $cmd
|
|
|
|
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
|
|
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
|
|
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
|
|
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
|
|
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
|
|
|
|
- name: Setup for extractor
|
|
run: |
|
|
echo $Env:CODEQL_PYTHON
|
|
|
|
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
|
|
|
|
- name: Verify packages installed
|
|
run: |
|
|
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
|
|
powershell -File $cmd $Env:PYTHON_VERSION
|