mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
100 lines
3.1 KiB
YAML
100 lines
3.1 KiB
YAML
name: Check framework coverage changes
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '.github/workflows/csv-coverage-pr-comment.yml'
|
|
- '*/ql/src/**/*.ql'
|
|
- '*/ql/src/**/*.qll'
|
|
- '*/ql/lib/**/*.ql'
|
|
- '*/ql/lib/**/*.qll'
|
|
- 'misc/scripts/library-coverage/*.py'
|
|
# input data files
|
|
- '*/documentation/library-coverage/cwe-sink.csv'
|
|
- '*/documentation/library-coverage/frameworks.csv'
|
|
branches:
|
|
- main
|
|
- 'rc/*'
|
|
|
|
jobs:
|
|
generate:
|
|
name: Generate framework coverage artifacts
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Dump GitHub context
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
|
|
run: echo "$GITHUB_CONTEXT"
|
|
- name: Clone self (github/codeql) - MERGE
|
|
uses: actions/checkout@v3
|
|
with:
|
|
path: merge
|
|
- name: Clone self (github/codeql) - BASE
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 2
|
|
path: base
|
|
- run: |
|
|
git checkout HEAD^1
|
|
git log -1 --format='%H'
|
|
working-directory: base
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: 3.8
|
|
- name: Download CodeQL CLI
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip"
|
|
- name: Unzip CodeQL CLI
|
|
run: unzip -d codeql-cli codeql-linux64.zip
|
|
- name: Generate CSV files on merge commit of the PR
|
|
run: |
|
|
echo "Running generator on merge"
|
|
PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge
|
|
mkdir out_merge
|
|
cp framework-coverage-*.csv out_merge/
|
|
cp framework-coverage-*.rst out_merge/
|
|
- name: Generate CSV files on base commit of the PR
|
|
run: |
|
|
echo "Running generator on base"
|
|
PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base
|
|
mkdir out_base
|
|
cp framework-coverage-*.csv out_base/
|
|
cp framework-coverage-*.rst out_base/
|
|
- name: Generate diff of coverage reports
|
|
run: |
|
|
python base/misc/scripts/library-coverage/compare-folders.py out_base out_merge comparison.md
|
|
- name: Upload CSV package list
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: csv-framework-coverage-merge
|
|
path: |
|
|
out_merge/framework-coverage-*.csv
|
|
out_merge/framework-coverage-*.rst
|
|
- name: Upload CSV package list
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: csv-framework-coverage-base
|
|
path: |
|
|
out_base/framework-coverage-*.csv
|
|
out_base/framework-coverage-*.rst
|
|
- name: Upload comparison results
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: comparison
|
|
path: |
|
|
comparison.md
|
|
- name: Save PR number
|
|
run: |
|
|
mkdir -p pr
|
|
echo ${{ github.event.pull_request.number }} > pr/NR
|
|
- name: Upload PR number
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: pr
|
|
path: pr/
|