Skip to content

Commit 1cae47a

Browse files
authored
build ultimate plugin each time on pr event #1836 (#1837)
1 parent cf1f74f commit 1cae47a

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

.github/workflows/build-and-run-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020
uses: ./.github/workflows/build-and-run-tests-from-branch.yml
2121
secrets: inherit
2222

23+
publish_plugin_and_cli:
24+
needs: build-and-run-tests
25+
uses: ./.github/workflows/publish-plugin-and-cli-from-branch.yml
26+
with:
27+
minor-release: 'none'
28+
# upload artifacts on push action to main only
29+
upload-artifact: ${{ github.event_name == 'push' }}
30+
secrets: inherit
2331

2432
publish-cli-image:
2533
needs: build-and-run-tests

.github/workflows/publish-plugin-and-cli-from-branch.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ on:
88
description: "It adds minor release indicator to version."
99
required: false
1010
default: 'none'
11-
1211
version-postfix:
1312
type: string
1413
description: "It adds postfix (alpha or beta) to version (optional)."
1514
required: false
1615
default: no-postfix
16+
upload-artifact:
17+
type: string
18+
description: "Upload artifacts or not"
19+
required: false
20+
default: false
1721

1822
workflow_dispatch:
1923
inputs:
@@ -28,7 +32,6 @@ on:
2832
- '2'
2933
- '3'
3034
- '4'
31-
3235
version-postfix:
3336
type: choice
3437
description: "It adds alpha or beta postfix to version."
@@ -39,48 +42,60 @@ on:
3942
- no-postfix
4043
- alpha
4144
- beta
45+
upload-artifact:
46+
type: choice
47+
description: "Upload artifacts or not"
48+
required: false
49+
default: true
50+
options:
51+
- true
52+
- false
4253

4354
jobs:
4455
publish_plugin_and_cli:
56+
strategy:
57+
fail-fast: false # force to execute all jobs even though some of them have failed
58+
matrix:
59+
configuration:
60+
- plugin_type: IC
61+
extra_options: "-PideType=IC"
62+
- plugin_type: IU
63+
extra_options: "-PideType=IU"
4564
runs-on: ubuntu-20.04
4665
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
47-
4866
steps:
49-
- name: Print environment variables
50-
run: printenv
51-
5267
- uses: actions/checkout@v3
5368

69+
# "You can make an environment variable available to any subsequent steps in a workflow job by
70+
# defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
5471
- name: Set environment variables
5572
run: |
56-
# "You can make an environment variable available to any subsequent steps in a workflow job by
57-
# defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
5873
echo "VERSION="$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}"" >> $GITHUB_ENV
5974
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV
60-
6175
- name: Set production version
6276
if: ${{ github.event.inputs.version-postfix == 'no-postfix-prod' || github.event.inputs.version-postfix == 'alpha' || github.event.inputs.version-postfix == 'beta' }}
6377
run: |
6478
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
65-
6679
- name: Set version for minor release
6780
if: ${{ github.event.inputs.minor-release != 'none' }}
6881
run: |
6982
echo "VERSION=${{ env.VERSION }}.${{ github.event.inputs.minor-release }}" >> $GITHUB_ENV
70-
7183
- name: Create version with postfix
7284
if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }}
7385
run:
7486
echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV
87+
- name: Print environment variables
88+
run: printenv
7589

7690
- name: Build UTBot IntelliJ IDEA plugin
7791
run: |
78-
gradle clean buildPlugin --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
92+
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 }}
7993
cd utbot-intellij/build/distributions
8094
unzip utbot-intellij-${{ env.VERSION }}.zip
8195
rm utbot-intellij-${{ env.VERSION }}.zip
8296
8397
- name: Archive UTBot IntelliJ IDEA plugin
98+
if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }}
8499
uses: actions/upload-artifact@v3
85100
with:
86101
name: utbot-intellij-${{ env.VERSION }}
@@ -90,8 +105,9 @@ jobs:
90105
run: |
91106
cd utbot-cli
92107
gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
93-
108+
94109
- name: Archive UTBot CLI
110+
if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }}
95111
uses: actions/upload-artifact@v3
96112
with:
97113
name: utbot-cli-${{ env.VERSION }}

.github/workflows/publish-plugin-and-cli.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)