1+ name : Test Python Package Installation
2+
3+ on :
4+ push :
5+ branches : [main, v1]
6+ pull_request :
7+
8+ jobs :
9+
10+ test-setup-python-scripts :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ include :
16+ - test_dir : python-setup/tests/pipenv/requests-2
17+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
18+ - test_dir : python-setup/tests/pipenv/requests-3
19+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
20+
21+ - test_dir : python-setup/tests/poetry/requests-2
22+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
23+ - test_dir : python-setup/tests/poetry/requests-3
24+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
25+
26+ - test_dir : python-setup/tests/requirements/requests-2
27+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
28+ - test_dir : python-setup/tests/requirements/requests-3
29+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
30+
31+ - test_dir : python-setup/tests/setup_py/requests-2
32+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
33+ - test_dir : python-setup/tests/setup_py/requests-3
34+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
35+
36+ # This one shouldn't fail, but also won't install packages
37+ - test_dir : python-setup/tests/requirements/non-standard-location
38+ test_script : test -z $LGTM_INDEX_IMPORT_PATH
39+
40+ # All of these should fail
41+ - test_dir : python-setup/tests/pipenv/python-version-not-available
42+ test_script : /bin/false
43+ - test_dir : python-setup/tests/poetry/python-version-not-available
44+ test_script : /bin/false
45+ - test_dir : python-setup/tests/requirements/invalid-package
46+ test_script : /bin/false
47+ - test_dir : python-setup/tests/requirements/invalid-version
48+ test_script : /bin/false
49+ - test_dir : python-setup/tests/setup_py/invalid-version
50+ test_script : /bin/false
51+ - test_dir : python-setup/tests/setup_py/invalid-file
52+ test_script : /bin/false
53+ - test_dir : python-setup/tests/setup_py/extra-require-not-installed
54+ test_script : $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
55+ - test_dir : python-setup/tests/setup_py/wrong-python-version
56+ test_script : /bin/false
57+
58+ steps :
59+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
60+ - uses : actions/checkout@v2
61+
62+ - name : Initialize CodeQL
63+ uses : github/codeql-action/init@v1
64+ with :
65+ languages : python
66+
67+ - name : Test Auto Package Installation
68+ run : |
69+ set -x
70+ $GITHUB_WORKSPACE/python-setup/install_tools.sh
71+ echo -e '\n\n\n\n\n' && sleep 0.5
72+ cd $GITHUB_WORKSPACE/${{ matrix.test_dir }}
73+ $GITHUB_WORKSPACE/python-setup/auto_install_packages.py /opt/hostedtoolcache/CodeQL/0.0.0-20200826/x64/codeql/
74+ - name : Setup for extractor
75+ run : |
76+ echo $CODEQL_PYTHON
77+ # only run if $CODEQL_PYTHON is set
78+ test ! -z $CODEQL_PYTHON && $GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON || /bin/true
79+ - name : Verify packages installed
80+ run : |
81+ ${{ matrix.test_script }}
0 commit comments