Skip to content

Commit a1fc3a5

Browse files
authored
Merge pull request #155 from github/daverlo/python
Python deps setup
2 parents 1a91a07 + 55eb02c commit a1fc3a5

36 files changed

Lines changed: 780 additions & 5 deletions

.github/workflows/python-deps.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
steps:
41+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
42+
- uses: actions/checkout@v2
43+
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: python
48+
49+
- name: Test Auto Package Installation
50+
run: |
51+
set -x
52+
$GITHUB_WORKSPACE/python-setup/install_tools.sh
53+
echo -e '\n\n\n\n\n' && sleep 0.5
54+
cd $GITHUB_WORKSPACE/${{ matrix.test_dir }}
55+
find /opt/hostedtoolcache/CodeQL -path "*x64/codeql" -exec $GITHUB_WORKSPACE/python-setup/auto_install_packages.py {} \;
56+
- name: Setup for extractor
57+
run: |
58+
echo $CODEQL_PYTHON
59+
# only run if $CODEQL_PYTHON is set
60+
test ! -z $CODEQL_PYTHON && $GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON || /bin/true
61+
- name: Verify packages installed
62+
run: |
63+
${{ matrix.test_script }}

init/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ inputs:
1919
queries:
2020
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
2121
required: false
22+
setup-python-dependencies:
23+
description: Try to auto-install your python dependencies
24+
required: true
25+
default: 'true'
2226
runs:
2327
using: 'node12'
2428
main: '../lib/init-action.js'

lib/analyze.js

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)