FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Include matrix information in debug artifact name by edoardopirovano · Pull Request #809 · github/codeql-action · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .map  (1) .ts  (1) .yml  (2) All 4 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion .github/workflows/__debug-artifacts.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pr-checks/checks/debug-artifacts.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
id: analysis
- uses: actions/download-artifact@v2
with:
name: debug-artifacts
name: debug-artifacts-${{ matrix.os }}-${{ matrix.version }}
- shell: bash
run: |
LANGUAGES="cpp csharp go java javascript python"
Expand Down
8 changes: 7 additions & 1 deletion src/analyze-action.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,14 @@ async function run() {
}

async function uploadDebugArtifacts(toUpload: string[], rootDir: string) {
let suffix = "";
const matrix = actionsUtil.getRequiredInput("matrix");
if (matrix !== undefined && matrix !== "null") {
for (const entry of Object.entries(JSON.parse(matrix)).sort())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How does sort work if the keys are arrays? I did a little test and it seems to work. Also, we only need this functionality to ensure our tests work, so even if the sorting is not stable, if our tests pass consistently, I'm not too worried.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I believe the default way to compare two arrays in TypeScript is lexicographically. Since in this case the first element is the key of a JSON map, we know that all the arrays will differ in their first element (since the keys must be unique), so this is equivalent to sorting by the name of the key.

suffix += `-${entry[1]}`;
}
await artifact.create().uploadArtifact(
DEBUG_ARTIFACT_NAME,
`${DEBUG_ARTIFACT_NAME}${suffix}`,
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir)
);
Expand Down

Back | FazBrowse Home | New Git URL