Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ env:
DOCKERFILE_PATH: docker/Dockerfile_java_cli

jobs:
build-and-run-tests:
uses: ./.github/workflows/build-and-run-tests-from-branch.yml
secrets: inherit
# build-and-run-tests:
# uses: ./.github/workflows/build-and-run-tests-from-branch.yml
# secrets: inherit

publish_plugin_and_cli:
# needs: build-and-run-tests
uses: ./.github/workflows/publish-plugin-and-cli-from-branch.yml
with:
minor-release: 'none'
upload-artifact: 'true'
# upload-artifact: false
secrets: inherit

publish-cli-image:
needs: build-and-run-tests
# needs: build-and-run-tests
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-20.04
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
Expand Down
45 changes: 32 additions & 13 deletions .github/workflows/publish-plugin-and-cli-from-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ on:
description: "It adds minor release indicator to version."
required: false
default: 'none'

version-postfix:
type: string
description: "It adds postfix (alpha or beta) to version (optional)."
required: false
default: no-postfix
upload-artifact:
type: string
description: "Upload artifacts or not"
required: false
default: 'false'

workflow_dispatch:
inputs:
Expand All @@ -28,7 +32,6 @@ on:
- '2'
- '3'
- '4'

version-postfix:
type: choice
description: "It adds alpha or beta postfix to version."
Expand All @@ -39,48 +42,63 @@ on:
- no-postfix
- alpha
- beta
upload-artifact:
type: string
description: "Upload artifacts or not"
required: false
default: false

jobs:
publish_plugin_and_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"
- plugin_type: IU
extra_options: "-PideType=IU"
runs-on: ubuntu-20.04
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0

steps:
- name: Print environment variables
run: printenv

- uses: actions/checkout@v3

# "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: Set environment variables
run: |
# "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."
echo "VERSION="$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}"" >> $GITHUB_ENV
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV

- name: Set production version
if: ${{ github.event.inputs.version-postfix == 'no-postfix-prod' || github.event.inputs.version-postfix == 'alpha' || github.event.inputs.version-postfix == 'beta' }}
run: |
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV

- name: Set version for minor release
if: ${{ github.event.inputs.minor-release != 'none' }}
run: |
echo "VERSION=${{ env.VERSION }}.${{ github.event.inputs.minor-release }}" >> $GITHUB_ENV

- name: Create version with postfix
if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }}
run:
echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV
- name: Print environment variables
run: printenv

- name: debug
run: |
echo ${{ inputs.upload-artifact }}
echo ${{ inputs.upload-artifact == 'true' }}
echo ${{ matrix.configuration.plugin_type == 'IC' }}

- name: Build UTBot IntelliJ IDEA plugin
run: |
gradle clean buildPlugin --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
gradle clean buildPlugin --no-daemon --build-cache --no-parallel ${{ matrix.configuration.extra_options }} -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
cd utbot-intellij/build/distributions
unzip utbot-intellij-${{ env.VERSION }}.zip
rm utbot-intellij-${{ env.VERSION }}.zip

- name: Archive UTBot IntelliJ IDEA plugin
if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }}
uses: actions/upload-artifact@v3
with:
name: utbot-intellij-${{ env.VERSION }}
Expand All @@ -90,8 +108,9 @@ jobs:
run: |
cd utbot-cli
gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}

- name: Archive UTBot CLI
if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }}
uses: actions/upload-artifact@v3
with:
name: utbot-cli-${{ env.VERSION }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-plugin-and-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ jobs:
uses: ./.github/workflows/publish-plugin-and-cli-from-branch.yml
with:
minor-release: 'none'
upload-artifact: 'true'
secrets: inherit
Loading