-
Notifications
You must be signed in to change notification settings - Fork 45
Publish python-, js- and go-cli on GitHub Actions #2236
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e4363af
Update publish-plugin-and-cli-from-branch.yml
tamarinvs19 b8ba307
Merge branch 'main' of https://github.com/UnitTestBot/UTBotJava into ...
bissquit 0735f88
workflows rewrited to split plugin and cli building
bissquit 5146c16
fix artifact path
bissquit 7e987bd
temporary upload artifacts
bissquit 5c35f53
Merge branch 'main' of https://github.com/UnitTestBot/UTBotJava into ...
bissquit 1449986
reverted from test to prod behavior
bissquit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
99 changes: 99 additions & 0 deletions
.github/workflows/publish-cli-from-branch.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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: "[M] CLI: publish as archive" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
upload-artifact: | ||
type: string | ||
description: "Upload artifacts or not" | ||
required: false | ||
default: false | ||
commit_sha: | ||
required: false | ||
type: string | ||
description: "(optional) Commit SHA" | ||
custom_version: | ||
type: string | ||
description: "Custom version" | ||
required: false | ||
default: "" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
upload-artifact: | ||
type: choice | ||
description: "Upload artifacts or not" | ||
required: false | ||
default: true | ||
options: | ||
- true | ||
- false | ||
commit_sha: | ||
required: false | ||
type: string | ||
description: "(optional) Commit SHA" | ||
custom_version: | ||
type: string | ||
description: "Custom version" | ||
required: false | ||
default: "" | ||
|
||
jobs: | ||
publish_cli: | ||
strategy: | ||
fail-fast: false # force to execute all jobs even though some of them have failed | ||
matrix: | ||
configuration: | ||
- plugin_type: IC | ||
extra_options: "-PideType=IC" | ||
lang: java | ||
dir: utbot-cli | ||
- plugin_type: IC | ||
extra_options: "-PideType=IC" | ||
lang: python | ||
dir: utbot-cli-python | ||
- plugin_type: IU | ||
extra_options: "-PideType=IU" | ||
lang: go | ||
dir: utbot-cli-go | ||
- plugin_type: IU | ||
extra_options: "-PideType=IU" | ||
lang: js | ||
dir: utbot-cli-js | ||
runs-on: ubuntu-20.04 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's possible to update Ubuntu version |
||
container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check out ${{ github.event.inputs.commit_sha }} commit | ||
if: github.event.inputs.commit_sha != '' | ||
run: | | ||
git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
git fetch | ||
git checkout ${{ github.event.inputs.commit_sha }} | ||
|
||
# "You can make an environment variable available to any subsequent steps in a workflow job by | ||
# defining or updating the environment variable and writing this to the GITHUB_ENV environment file." | ||
- name: Setup custom version | ||
if: ${{ github.event.inputs.custom_version != '' }} | ||
run: | | ||
echo "VERSION=${{ github.event.inputs.custom_version }}" >> $GITHUB_ENV | ||
- name: Setup version | ||
if: ${{ github.event.inputs.custom_version == '' }} | ||
shell: bash | ||
run: | | ||
echo "VERSION=${GITHUB_REF_NAME:0:4}-$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | ||
|
||
- name: Print environment variables | ||
run: printenv | ||
|
||
- name: Build UTBot CLI | ||
run: | | ||
cd "${{ matrix.configuration.dir }}" | ||
gradle clean build --no-daemon --build-cache --no-parallel ${{ matrix.configuration.extra_options }} -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} | ||
|
||
- name: Archive UTBot CLI | ||
if: ${{ inputs.upload-artifact == 'true' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: utbot-cli-${{ matrix.configuration.lang }}-${{ env.VERSION }} | ||
path: ${{ matrix.configuration.dir }}/build/libs/${{ matrix.configuration.dir }}-${{ env.VERSION }}.jar |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.