Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always end tool install with where command #2668

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

Alan-Jowett
Copy link
Member

Description

Tool install commands should validate that the tool is installed and is present in the path via the where command.

Testing

CI/CD

Documentation

No.

@@ -123,6 +123,7 @@ jobs:
run: |
choco install -y llvm --version 11.0.1 --allow-downgrade
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
where clang.exe
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: does this also help fail the CICD step if the installation of the tool fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the exit code of the last command determines if the task succeeds or fails. The issue is that the choco install fails, but the next line (the "echo") succeeds, so the task wasn't being failed. By adding an explicit check for the binary, this will fail if the exe isn't present.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add that fact to the PR description in github. Thanks!

@Alan-Jowett Alan-Jowett added this pull request to the merge queue Jul 11, 2023
@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #2668 (5575e2b) into main (e79aecb) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2668      +/-   ##
==========================================
- Coverage   81.19%   81.17%   -0.03%     
==========================================
  Files         147      147              
  Lines       27784    27784              
==========================================
- Hits        22559    22553       -6     
- Misses       5225     5231       +6     

see 4 files with indirect coverage changes

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 11, 2023
@Alan-Jowett Alan-Jowett added this pull request to the merge queue Jul 11, 2023
Merged via the queue into microsoft:main with commit 090e627 Jul 11, 2023
68 checks passed
@Alan-Jowett Alan-Jowett deleted the issue2659 branch July 11, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants