Skip to content

Update CI scripts #47

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 7 commits into from
May 27, 2022
Merged
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
29 changes: 8 additions & 21 deletions .github/workflows/build-and-run-tests-from-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
workflow_dispatch

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

- name: Build UTBot Java
- name: Build and run tests in UTBot Java
run: |
export KOTLIN_HOME="/usr"
gradle clean build --no-daemon
Expand All @@ -29,29 +28,17 @@ jobs:
with:
name: utbot_framework_logs
path: utbot-framework/logs/*

- name: Create tests report archive if tests have failed
if: ${{ failure() }}
run: |
cd utbot-framework/build/reports/tests/test
tar -czpf tests_run_report.tar.gz *

- name: Upload tests report artifacts if tests have failed
- name: Upload utbot-framework tests report artifacts if tests have failed
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: tests_run_report.tar.gz
path: utbot-framework/build/reports/tests/test/tests_run_report.tar.gz

- name: Create IntelliJ IDEA plugin tests report archive if tests have failed
if: ${{ failure() }}
run: |
cd utbot-intellij/build/reports/tests/test
tar -czpf intellij_plugin_tests_run_report.tar.gz *
name: utbot_framework_tests_report
path: utbot-framework/build/reports/tests/test/*

- name: Upload IntelliJ IDEA plugin tests report artifacts if tests have failed
- name: Upload utbot-intellij tests report artifacts if tests have failed
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: intellij_plugin_tests_run_report.tar.gz
path: utbot-intellij/build/reports/tests/test/intellij_plugin_tests_run_report.tar.gz
name: utbot_intellij_tests_report
path: utbot-intellij/build/reports/tests/test/*
60 changes: 0 additions & 60 deletions .github/workflows/build-and-run-tests-utbot-java.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: UTBot Java build and run tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build_and_run_tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
java-package: jdk+fx
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 6.8

- name: Build and run tests in UTBot Java
run: |
export KOTLIN_HOME="/usr"
gradle clean build --no-daemon

- name: Upload utbot-framework logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: utbot_framework_logs
path: utbot-framework/logs/*

- name: Upload utbot-framework tests report artifacts if tests have failed
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: utbot_framework_tests_report
path: utbot-framework/build/reports/tests/test/*

- name: Upload utbot-intellij tests report artifacts if tests have failed
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: utbot_intellij_tests_report
path: utbot-intellij/build/reports/tests/test/*
65 changes: 65 additions & 0 deletions .github/workflows/publish-plugin-and-cli-from-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish plugin and CLI as archives

on:
workflow_dispatch:
inputs:
version-postfix:
type: choice
description: "It adds alpha or beta postfix to version."
required: true
default: no-postfix
options:
- no-postfix
- alpha
- beta

jobs:
publish_plugin_and_cli:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
java-package: jdk+fx
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 6.8

- name: Set environment variables
run: |
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV

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

- name: Build UTBot IntelliJ IDEA plugin
run: |
export KOTLIN_HOME="/usr"
gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }}
cd utbot-intellij/build/distributions
unzip utbot-intellij-${{ env.VERSION }}.zip

- name: Archive UTBot IntelliJ IDEA plugin
uses: actions/upload-artifact@v2
with:
name: utbot-intellij-${{ env.VERSION }}
path: utbot-intellij/build/distributions/*

- name: Build UTBot CLI
run: |
export KOTLIN_HOME="/usr"
cd utbot-cli
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}
cd build/libs

- name: Archive UTBot CLI
uses: actions/upload-artifact@v2
with:
name: utbot-cli-${{ env.VERSION }}
path: utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar
24 changes: 12 additions & 12 deletions .github/workflows/publish-plugin-and-cli.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: Publish utbot-intellij and utbot-cli as an archive
name: Publish plugin and CLI as archives

on:
push:
branches: [main]

jobs:
publish_utbot_java:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
publish_plugin_and_cli:
runs-on: ubuntu-20.04
env:
VERSION: ${{ format('1.0.{0}', github.run_number) }}


steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'liberica'
distribution: 'zulu'
java-package: jdk+fx
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 6.8

- name: Set environment variables
run:
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV

- name: Build UTBot IntelliJ IDEA plugin
run: |
export KOTLIN_HOME="/usr"
gradle buildPlugin
gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }}
cd utbot-intellij/build/distributions
mv $(find . -type f -iname "utbot-intellij*.zip") utbot-intellij-${{ env.VERSION }}.zip
unzip utbot-intellij-${{ env.VERSION }}.zip
rm utbot-intellij-${{ env.VERSION }}.zip

- name: Archive UTBot IntelliJ IDEA plugin
uses: actions/upload-artifact@v2
with:
Expand All @@ -40,9 +40,9 @@ jobs:
run: |
export KOTLIN_HOME="/usr"
cd utbot-cli
gradle clean build --no-daemon
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}
cd build/libs
mv $(find . -type f -iname "utbot-cli*.jar") utbot-cli-${{ env.VERSION }}.jar

- name: Archive UTBot CLI
uses: actions/upload-artifact@v2
with:
Expand Down