Skip to content

Commit e61f725

Browse files
committed
Apply code review findings
1 parent 4abaa78 commit e61f725

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

.github/workflows/csv-coverage-pr-artifacts.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@ on:
1515
- 'rc/*'
1616

1717
jobs:
18-
build:
18+
generate:
19+
name: Generate framework coverage artifacts
1920

2021
runs-on: ubuntu-latest
2122

2223
steps:
2324
- name: Dump GitHub context
2425
env:
25-
GITHUB_CONTEXT: ${{ toJSON(github) }}
26+
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
2627
run: echo "$GITHUB_CONTEXT"
27-
- name: Clone self (github/codeql) head
28+
- name: Clone self (github/codeql) - MERGE
2829
uses: actions/checkout@v2
2930
with:
30-
path: head
31-
- name: Clone self (github/codeql) base
31+
path: merge
32+
- name: Clone self (github/codeql) - BASE
3233
uses: actions/checkout@v2
3334
with:
3435
ref: ${{ github.event.pull_request.base.sha }}
@@ -38,21 +39,19 @@ jobs:
3839
with:
3940
python-version: 3.8
4041
- name: Download CodeQL CLI
41-
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
42-
with:
43-
repo: "github/codeql-cli-binaries"
44-
version: "latest"
45-
file: "codeql-linux64.zip"
46-
token: ${{ secrets.GITHUB_TOKEN }}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
run: |
45+
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip"
4746
- name: Unzip CodeQL CLI
4847
run: unzip -d codeql-cli codeql-linux64.zip
49-
- name: Generate CSV files on head and base of the PR
48+
- name: Generate CSV files on merge and base of the PR
5049
run: |
5150
echo "Running generator on ${{github.sha}}"
52-
PATH="$PATH:codeql-cli/codeql" python head/misc/scripts/library-coverage/generate-report.py ci head head
53-
mkdir out_head
54-
cp framework-coverage-*.csv out_head/
55-
cp framework-coverage-*.rst out_head/
51+
PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge
52+
mkdir out_merge
53+
cp framework-coverage-*.csv out_merge/
54+
cp framework-coverage-*.rst out_merge/
5655
5756
echo "Running generator on ${{github.event.pull_request.base.sha}}"
5857
PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base
@@ -64,8 +63,8 @@ jobs:
6463
with:
6564
name: csv-framework-coverage-merge
6665
path: |
67-
out_head/framework-coverage-*.csv
68-
out_head/framework-coverage-*.rst
66+
out_merge/framework-coverage-*.csv
67+
out_merge/framework-coverage-*.rst
6968
- name: Upload CSV package list
7069
uses: actions/upload-artifact@v2
7170
with:

.github/workflows/csv-coverage-pr-comment.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
- completed
88

99
jobs:
10-
build:
11-
10+
check:
11+
name: Check framework coverage differences and comment
1212
runs-on: ubuntu-latest
1313
if: >
1414
${{ github.event.workflow_run.event == 'pull_request' &&
@@ -17,47 +17,46 @@ jobs:
1717
steps:
1818
- name: Dump GitHub context
1919
env:
20-
GITHUB_CONTEXT: ${{ toJSON(github) }}
20+
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
2121
run: echo "$GITHUB_CONTEXT"
22-
- name: Clone self (github/codeql) head
22+
- name: Clone self (github/codeql)
2323
uses: actions/checkout@v2
24-
with:
25-
path: head
2624
- name: Set up Python 3.8
2725
uses: actions/setup-python@v2
2826
with:
2927
python-version: 3.8
3028

3129
# download artifacts from the PR job:
32-
- name: Download artifact - HEAD
33-
uses: dawidd6/action-download-artifact@v2.14.0
34-
with:
35-
workflow: csv-coverage-pr-artifacts.yml
36-
run_id: ${{ github.event.workflow_run.id }}
37-
name: csv-framework-coverage-merge
38-
path: out_head
30+
31+
- name: Download artifact - MERGE
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
RUN_ID: ${{ github.event.workflow_run.id }}
35+
run: |
36+
gh run download --name "csv-framework-coverage-merge" --dir "out_merge" "$RUN_ID"
3937
4038
- name: Download artifact - BASE
41-
uses: dawidd6/[email protected]
42-
with:
43-
workflow: csv-coverage-pr-artifacts.yml
44-
run_id: ${{ github.event.workflow_run.id }}
45-
name: csv-framework-coverage-base
46-
path: out_base
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
RUN_ID: ${{ github.event.workflow_run.id }}
42+
run: |
43+
gh run download --name "csv-framework-coverage-base" --dir "out_base" "$RUN_ID"
4744
4845
- name: Download artifact - PR
49-
uses: dawidd6/[email protected]
50-
with:
51-
workflow: csv-coverage-pr-artifacts.yml
52-
run_id: ${{ github.event.workflow_run.id }}
53-
name: pr
54-
path: pr
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
RUN_ID: ${{ github.event.workflow_run.id }}
49+
run: |
50+
gh run download --name "pr" --dir "pr" "$RUN_ID"
5551
5652
- name: Check coverage files
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
RUN_ID: ${{ github.event.workflow_run.id }}
5756
run: |
5857
PR=$(cat "pr/NR")
59-
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python head/misc/scripts/library-coverage/compare-files-comment-pr.py \
60-
out_head out_base comparison.md ${{ github.repository }} $PR ${{ github.event.workflow_run.id }}
58+
python misc/scripts/library-coverage/compare-files-comment-pr.py \
59+
out_merge out_base comparison.md ${{ github.repository }} $PR $RUN_ID
6160
- name: Upload comparison results
6261
uses: actions/upload-artifact@v2
6362
with:

0 commit comments

Comments
 (0)