-
Notifications
You must be signed in to change notification settings - Fork 36
workflow to run cli integration tests #349
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
base: main
Are you sure you want to change the base?
workflow to run cli integration tests #349
Conversation
| push: | ||
| branches: | ||
| - main | ||
| - master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we just have main branch in this repo, no point in keeping both
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - name: Detect replace directives |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a direct golang command for replace directives
go mod edit -replace ://github.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to replace all the dependencies with their forked branch in jfrog-cli, if branch not found, replace with master or leave it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see goTests and NugetTests are missing
| - name: macos | ||
| version: 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove macos until the issue is fixed
| # Function to extract repo and ref from replace directive | ||
| extract_replace() { | ||
| local module=$1 | ||
| local line=$(grep "^replace github.com/jfrog/$module " go.mod 2>/dev/null | head -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this parsing is not reliable, please use go mod edit -json instead.
| - name: Add replace directives (Unix) | ||
| if: matrix.os.name == 'ubuntu' | ||
| shell: bash | ||
| run: | | ||
| cd jfrog-cli | ||
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | ||
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | ||
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | ||
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use go work (workspaces) which is a cleaner approach.
| echo "" | ||
|
|
||
| # Check for build-info-go | ||
| BUILD_INFO=$(extract_replace "build-info-go") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this logic be removed as shell script, and write logic in either python or go. go mod edit -json can be used along to perform right replacements.
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | ||
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a repeating pattern use composite Github acton
Added workflow to run cli e2e testcases.