Skip to content

Commit 6647432

Browse files
Update CI scripts closes #46 (#47)
1 parent 3341c9f commit 6647432

5 files changed

+132
-93
lines changed

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

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
workflow_dispatch
55

66
jobs:
7-
build-utbot-java:
8-
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
7+
build-and-run-tests:
98
runs-on: ubuntu-20.04
109
steps:
1110
- uses: actions/checkout@v2
@@ -18,7 +17,7 @@ jobs:
1817
with:
1918
gradle-version: 6.8
2019

21-
- name: Build UTBot Java
20+
- name: Build and run tests in UTBot Java
2221
run: |
2322
export KOTLIN_HOME="/usr"
2423
gradle clean build --no-daemon
@@ -29,29 +28,17 @@ jobs:
2928
with:
3029
name: utbot_framework_logs
3130
path: utbot-framework/logs/*
32-
33-
- name: Create tests report archive if tests have failed
34-
if: ${{ failure() }}
35-
run: |
36-
cd utbot-framework/build/reports/tests/test
37-
tar -czpf tests_run_report.tar.gz *
3831

39-
- name: Upload tests report artifacts if tests have failed
32+
- name: Upload utbot-framework tests report artifacts if tests have failed
4033
if: ${{ failure() }}
4134
uses: actions/upload-artifact@v2
4235
with:
43-
name: tests_run_report.tar.gz
44-
path: utbot-framework/build/reports/tests/test/tests_run_report.tar.gz
45-
46-
- name: Create IntelliJ IDEA plugin tests report archive if tests have failed
47-
if: ${{ failure() }}
48-
run: |
49-
cd utbot-intellij/build/reports/tests/test
50-
tar -czpf intellij_plugin_tests_run_report.tar.gz *
36+
name: utbot_framework_tests_report
37+
path: utbot-framework/build/reports/tests/test/*
5138

52-
- name: Upload IntelliJ IDEA plugin tests report artifacts if tests have failed
39+
- name: Upload utbot-intellij tests report artifacts if tests have failed
5340
if: ${{ failure() }}
5441
uses: actions/upload-artifact@v2
5542
with:
56-
name: intellij_plugin_tests_run_report.tar.gz
57-
path: utbot-intellij/build/reports/tests/test/intellij_plugin_tests_run_report.tar.gz
43+
name: utbot_intellij_tests_report
44+
path: utbot-intellij/build/reports/tests/test/*

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

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: UTBot Java build and run tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build_and_run_tests:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-java@v2
15+
with:
16+
java-version: '8'
17+
distribution: 'zulu'
18+
java-package: jdk+fx
19+
- uses: gradle/gradle-build-action@v2
20+
with:
21+
gradle-version: 6.8
22+
23+
- name: Build and run tests in UTBot Java
24+
run: |
25+
export KOTLIN_HOME="/usr"
26+
gradle clean build --no-daemon
27+
28+
- name: Upload utbot-framework logs
29+
if: ${{ always() }}
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: utbot_framework_logs
33+
path: utbot-framework/logs/*
34+
35+
- name: Upload utbot-framework tests report artifacts if tests have failed
36+
if: ${{ failure() }}
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: utbot_framework_tests_report
40+
path: utbot-framework/build/reports/tests/test/*
41+
42+
- name: Upload utbot-intellij tests report artifacts if tests have failed
43+
if: ${{ failure() }}
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: utbot_intellij_tests_report
47+
path: utbot-intellij/build/reports/tests/test/*
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Publish plugin and CLI as archives
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version-postfix:
7+
type: choice
8+
description: "It adds alpha or beta postfix to version."
9+
required: true
10+
default: no-postfix
11+
options:
12+
- no-postfix
13+
- alpha
14+
- beta
15+
16+
jobs:
17+
publish_plugin_and_cli:
18+
runs-on: ubuntu-20.04
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-java@v2
23+
with:
24+
java-version: '8'
25+
distribution: 'zulu'
26+
java-package: jdk+fx
27+
- uses: gradle/gradle-build-action@v2
28+
with:
29+
gradle-version: 6.8
30+
31+
- name: Set environment variables
32+
run: |
33+
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
34+
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV
35+
36+
- name: Create version with postfix
37+
if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }}
38+
run:
39+
echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV
40+
41+
- name: Build UTBot IntelliJ IDEA plugin
42+
run: |
43+
export KOTLIN_HOME="/usr"
44+
gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }}
45+
cd utbot-intellij/build/distributions
46+
unzip utbot-intellij-${{ env.VERSION }}.zip
47+
48+
- name: Archive UTBot IntelliJ IDEA plugin
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: utbot-intellij-${{ env.VERSION }}
52+
path: utbot-intellij/build/distributions/*
53+
54+
- name: Build UTBot CLI
55+
run: |
56+
export KOTLIN_HOME="/usr"
57+
cd utbot-cli
58+
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}
59+
cd build/libs
60+
61+
- name: Archive UTBot CLI
62+
uses: actions/upload-artifact@v2
63+
with:
64+
name: utbot-cli-${{ env.VERSION }}
65+
path: utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
name: Publish utbot-intellij and utbot-cli as an archive
1+
name: Publish plugin and CLI as archives
22

33
on:
44
push:
55
branches: [main]
66

77
jobs:
8-
publish_utbot_java:
9-
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
8+
publish_plugin_and_cli:
109
runs-on: ubuntu-20.04
11-
env:
12-
VERSION: ${{ format('1.0.{0}', github.run_number) }}
13-
10+
1411
steps:
1512
- uses: actions/checkout@v2
1613
- uses: actions/setup-java@v2
1714
with:
1815
java-version: '8'
19-
distribution: 'liberica'
16+
distribution: 'zulu'
2017
java-package: jdk+fx
2118
- uses: gradle/gradle-build-action@v2
2219
with:
2320
gradle-version: 6.8
2421

22+
- name: Set environment variables
23+
run:
24+
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
25+
2526
- name: Build UTBot IntelliJ IDEA plugin
2627
run: |
2728
export KOTLIN_HOME="/usr"
28-
gradle buildPlugin
29+
gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }}
2930
cd utbot-intellij/build/distributions
30-
mv $(find . -type f -iname "utbot-intellij*.zip") utbot-intellij-${{ env.VERSION }}.zip
3131
unzip utbot-intellij-${{ env.VERSION }}.zip
32-
rm utbot-intellij-${{ env.VERSION }}.zip
32+
3333
- name: Archive UTBot IntelliJ IDEA plugin
3434
uses: actions/upload-artifact@v2
3535
with:
@@ -40,9 +40,9 @@ jobs:
4040
run: |
4141
export KOTLIN_HOME="/usr"
4242
cd utbot-cli
43-
gradle clean build --no-daemon
43+
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}
4444
cd build/libs
45-
mv $(find . -type f -iname "utbot-cli*.jar") utbot-cli-${{ env.VERSION }}.jar
45+
4646
- name: Archive UTBot CLI
4747
uses: actions/upload-artifact@v2
4848
with:

0 commit comments

Comments
 (0)