Skip to content

Commit 602f709

Browse files
authored
Merge branch 'main' into add-multi-cause-markdown-flag
2 parents 740147a + abe6b7b commit 602f709

File tree

14 files changed

+225
-148
lines changed

14 files changed

+225
-148
lines changed

.github/workflows/python-deps-linux.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/python-deps-windows.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/python-deps.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Test Python Package Installation on Linux and Mac
2+
3+
on:
4+
push:
5+
branches: [main, v1]
6+
pull_request:
7+
8+
jobs:
9+
10+
test-setup-python-scripts:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
include:
17+
- test_dir: python-setup/tests/pipenv/requests-2
18+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
19+
- test_dir: python-setup/tests/pipenv/requests-3
20+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
21+
22+
- test_dir: python-setup/tests/poetry/requests-2
23+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
24+
- test_dir: python-setup/tests/poetry/requests-3
25+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
26+
27+
- test_dir: python-setup/tests/requirements/requests-2
28+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
29+
- test_dir: python-setup/tests/requirements/requests-3
30+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
31+
32+
- test_dir: python-setup/tests/setup_py/requests-2
33+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
34+
- test_dir: python-setup/tests/setup_py/requests-3
35+
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3
36+
37+
# This one shouldn't fail, but also won't install packages
38+
- test_dir: python-setup/tests/requirements/non-standard-location
39+
test_script: test -z $LGTM_INDEX_IMPORT_PATH
40+
41+
steps:
42+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
43+
- uses: actions/checkout@v2
44+
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
tools: latest
49+
languages: python
50+
51+
- name: Test Auto Package Installation
52+
run: |
53+
set -x
54+
$GITHUB_WORKSPACE/python-setup/install_tools.sh
55+
56+
cd $GITHUB_WORKSPACE/${{ matrix.test_dir }}
57+
58+
case ${{ matrix.os }} in
59+
ubuntu-latest*) basePath="/opt";;
60+
macos-latest*) basePath="/Users/runner";;
61+
esac
62+
echo ${basePath}
63+
64+
codeql_version="0.0.0-$(cat "$GITHUB_WORKSPACE/src/defaults.json" | jq -r .bundleVersion | rev | cut -d - -f 1 | rev)"
65+
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "${basePath}/hostedtoolcache/CodeQL/$codeql_version/x64/codeql"
66+
- name: Setup for extractor
67+
run: |
68+
echo $CODEQL_PYTHON
69+
# only run if $CODEQL_PYTHON is set
70+
if [ ! -z $CODEQL_PYTHON ]; then
71+
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
72+
fi
73+
- name: Verify packages installed
74+
run: |
75+
${{ matrix.test_script }}
76+
77+
test-setup-python-scripts-windows:
78+
runs-on: windows-latest
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
include:
83+
- test_dir: python-setup/tests/pipenv/requests-2
84+
python_version: 2
85+
- test_dir: python-setup/tests/pipenv/requests-3
86+
python_version: 3
87+
88+
- test_dir: python-setup/tests/poetry/requests-2
89+
python_version: 2
90+
- test_dir: python-setup/tests/poetry/requests-3
91+
python_version: 3
92+
93+
- test_dir: python-setup/tests/requirements/requests-2
94+
python_version: 2
95+
- test_dir: python-setup/tests/requirements/requests-3
96+
python_version: 3
97+
98+
- test_dir: python-setup/tests/setup_py/requests-2
99+
python_version: 2
100+
- test_dir: python-setup/tests/setup_py/requests-3
101+
python_version: 3
102+
103+
steps:
104+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
105+
- uses: actions/checkout@v2
106+
107+
- name: Initialize CodeQL
108+
uses: github/codeql-action/init@v1
109+
with:
110+
tools: latest
111+
languages: python
112+
113+
- name: Test Auto Package Installation
114+
run: |
115+
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
116+
powershell -File $cmd
117+
118+
cd $Env:GITHUB_WORKSPACE\\${{ matrix.test_dir }}
119+
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
120+
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
121+
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
122+
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
123+
- name: Setup for extractor
124+
run: |
125+
echo $Env:CODEQL_PYTHON
126+
127+
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
128+
- name: Verify packages installed
129+
run: |
130+
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
131+
powershell -File $cmd ${{ matrix.python_version }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release runner
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bundle-tag:
7+
description: 'Tag of the bundle release (e.g., "codeql-bundle-20200826")'
8+
required: false
9+
10+
jobs:
11+
release-runner:
12+
runs-on: ubuntu-latest
13+
env:
14+
RELEASE_TAG: "${{ github.event.inputs.bundle-tag }}"
15+
16+
strategy:
17+
matrix:
18+
extension: ["linux", "macos", "win.exe"]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Build runner
24+
run: |
25+
cd runner
26+
npm install
27+
npm run build-runner
28+
29+
- uses: actions/upload-artifact@v2
30+
with:
31+
name: codeql-runner-${{matrix.extension}}
32+
path: runner/dist/codeql-runner-${{matrix.extension}}
33+
34+
- name: Resolve Upload URL for the release
35+
if: ${{ github.event.inputs.bundle-tag != null }}
36+
id: save_url
37+
run: |
38+
UPLOAD_URL=$(curl -sS \
39+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_TAG}" \
40+
-H "Accept: application/json" \
41+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq .upload_url | sed s/\"//g)
42+
echo ${UPLOAD_URL}
43+
echo "::set-output name=upload_url::${UPLOAD_URL}"
44+
45+
- name: Upload Platform Package
46+
if: ${{ github.event.inputs.bundle-tag != null }}
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.save_url.outputs.upload_url }}
52+
asset_path: runner/dist/codeql-runner-${{matrix.extension}}
53+
asset_name: codeql-runner-${{matrix.extension}}
54+
asset_content_type: application/octet-stream

lib/analyze-action.js

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

lib/analyze-action.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/analyze.js

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

0 commit comments

Comments
 (0)