Skip to content

Commit 10a29f8

Browse files
authored
Merge branch 'main' into dependabot/gradle/remote-robot-0.11.23
2 parents 4adfd8e + 0227446 commit 10a29f8

File tree

10 files changed

+439
-66
lines changed

10 files changed

+439
-66
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,28 @@ jobs:
2929
name: prInfo
3030
path: prInfo/
3131

32+
verify_dependencies:
33+
runs-on: ubuntu-latest
34+
if: github.event_name == 'pull_request'
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Set up JDK 17
39+
uses: actions/setup-java@v4
40+
with:
41+
java-version: 17
42+
distribution: 'temurin'
43+
cache: 'gradle'
44+
- name: Run verification dependency
45+
run: |
46+
./gradlew --dependency-verification strict build
47+
- name: Archiving reports
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: dependency-reports
51+
path: build/reports/dependency-verification/*
52+
if: always()
53+
3254
run_on_linux:
3355
runs-on: ubuntu-latest
3456

.github/workflows/nightly.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish Nightly Build
2+
3+
on:
4+
schedule:
5+
- cron: '10 7 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
should-build-change:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
repo-cache-hit: ${{ steps.cache-last-commit.outputs.cache-hit }}
13+
steps:
14+
- name: Fetch Sources
15+
uses: actions/checkout@v4
16+
- run: |
17+
git rev-parse HEAD >> lastCommit
18+
- name: Check New Changes
19+
id: cache-last-commit
20+
uses: actions/cache@v4
21+
with:
22+
path: lastCommit
23+
key: lastCommit-${{ hashFiles('lastCommit') }}
24+
25+
release-snapshot-job:
26+
needs: should-build-change
27+
if: ${{ needs.should-build-change.outputs.repo-cache-hit != 'true' || github.event_name != 'schedule' }}
28+
name: Publish Snapshot
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: write
32+
pull-requests: write
33+
steps:
34+
# Check out current repository
35+
- name: Fetch Sources
36+
uses: actions/checkout@v4
37+
38+
# Set up Java environment for the next steps
39+
- name: Setup Java
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: 'temurin'
43+
java-version: 17
44+
cache: 'gradle'
45+
46+
# Setup Gradle
47+
- name: Setup Gradle
48+
uses: gradle/actions/setup-gradle@v4
49+
50+
# Build plugin
51+
- name: Build Plugin
52+
run: ./gradlew build
53+
54+
# Publish to Maven repo
55+
- name: Checkout Maven Repo
56+
uses: actions/checkout@v4
57+
with:
58+
ref: repository
59+
path: mvn-repo
60+
61+
- name: Deploy to Maven Repository
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
run: |
65+
CURRENT_VERSION=$(grep "projectVersion=" gradle.properties | cut -d'=' -f2)
66+
./gradlew publish
67+
68+
git config --global user.email "[email protected]"
69+
git config --global user.name "GitHub Action Bot"
70+
mv build/repository mvn-repo
71+
git commit -am "Publish ${CURRENT_VERSION} (${{github.run_number}})"
72+
git push -f origin repository

.github/workflows/release.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Release
2+
run-name: Release ${{ inputs.release_version }}
3+
4+
#Only one job at a time
5+
concurrency: release
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
release_version:
11+
description: 'Release version'
12+
required: true
13+
type: string
14+
15+
jobs:
16+
release:
17+
name: Publish
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
steps:
23+
# Check out current repository
24+
- name: Fetch Sources
25+
uses: actions/checkout@v4
26+
27+
# Set up Java environment for the next steps
28+
- name: Setup Java
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: 'temurin'
32+
java-version: 17
33+
cache: 'gradle'
34+
35+
# Setup Gradle
36+
- name: Setup Gradle
37+
uses: gradle/actions/setup-gradle@v4
38+
39+
- name: Tag Release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
git config user.email "[email protected]"
44+
git config user.name "GitHub Action"
45+
if git diff --quiet; then
46+
echo "No changes to commit."
47+
else
48+
git commit -sam "chore(skip-release): set version to ${{ inputs.release_version }}"
49+
fi
50+
git tag ${{ inputs.release_version }}
51+
git push origin ${{ inputs.release_version }}
52+
53+
- name: Set Release Version
54+
shell: bash
55+
run: |
56+
CURRENT_VERSION=$(grep "projectVersion=" gradle.properties | cut -d'=' -f2)
57+
NEW_VERSION=${{ inputs.release_version }}
58+
awk -v current="$CURRENT_VERSION" -v new="$NEW_VERSION" 'BEGIN {FS=OFS="="} $1 == "projectVersion" { $2 = new }1' gradle.properties > tmpfile && mv tmpfile gradle.properties
59+
echo "Release version: $NEW_VERSION"
60+
echo "PLUGIN_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
61+
62+
# Publish the plugin to local release repo
63+
- name: Publish Library
64+
run: |
65+
./gradlew publish
66+
echo "Published $PLUGIN_VERSION."
67+
68+
# Set next SNAPSHOT version
69+
- name: Increment Plugin Version
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
run: |
73+
CURRENT_VERSION=$(grep "projectVersion=" gradle.properties | cut -d'=' -f2)
74+
IFS="-" read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
75+
IFS="." read -ra VERSION_NUM <<< "${VERSION_PARTS[0]}"
76+
((VERSION_NUM[2]+=1))
77+
NEW_VERSION="${VERSION_NUM[0]}.${VERSION_NUM[1]}.${VERSION_NUM[2]}-SNAPSHOT"
78+
awk -v new_version="$NEW_VERSION" '/projectVersion=/{sub(/=.*/, "=" new_version)}1' gradle.properties > tmpfile && mv tmpfile gradle.properties
79+
echo "Set $NEW_VERSION in gradle.properties"
80+
git checkout -b $NEW_VERSION
81+
git commit -sam "chore(skip-release): set version to $NEW_VERSION"
82+
git push -u origin $NEW_VERSION
83+
84+
- name: Simple conventional changelog
85+
uses: redhat-developer/simple-conventional-changelog@0a6db1ac3910c2cf66f2e1a530951dba1ece8540 #0.0.12
86+
id: changelog
87+
with:
88+
token: ${{ secrets.GITHUB_TOKEN }}
89+
current-tag: ${{ inputs.release_version }}
90+
types-mapping: 'feat:Features,fix:Bug Fixes,docs:Documentation,refactor:Refactoring,build:Build,chore:Other'
91+
92+
# Create a new GitHub release
93+
- name: Create GitHub Release
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
run: |
97+
gh release create ${{ inputs.release_version }} \
98+
--title "${{ inputs.release_version }}" \
99+
--notes "$(cat << 'EOM'
100+
${{ steps.changelog.outputs.changelog }}
101+
EOM
102+
)"
103+
104+
- name: Upload Release Asset
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
run: gh release upload ${{ inputs.release_version }} ./build/libs/*.jar

CONTRIBUTING.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Package <i>fixtures</i> contains several predefined fixtures that can be instant
1919

2020
### 2) Package <i>utils</i>
2121

22-
Package <i>utils</i> contains static methods and constants that can be useful for writing IntelliJ IDEA UI tests. There are for example methods for taking sceenshots or creating new project without the need of implementing the whole process using provided fixtures.
22+
Package <i>utils</i> contains static methods and constants that can be useful for writing IntelliJ IDEA UI tests. There are for example methods for taking screenshots or creating new project without the need of implementing the whole process using provided fixtures.
2323

2424
### 3) Package <i>exceptions</i>
2525

26-
Package <i>exceptions</i> contains predefined exceptions for handling situation such as the object that I am creating fixture for does not exists or there is unrelevant or unsupported option passed into a method.
26+
Package <i>exceptions</i> contains predefined exceptions for handling situation such as the object that I am creating fixture for does not exist or there is un-relevant or unsupported option passed into a method.
2727

2828
### 4) Class <i>UITestRunner</i>
2929

@@ -59,18 +59,9 @@ $ cd ./src/test-project
5959
$ ./gradlew clean integrationUITest
6060
```
6161

62-
To execute the JUnit 5 tests with **Ultimate** version of IntelliJ:
63-
1. Decrypt **idea.key.gpg** file inside `./src/test-project/idea_license_key`
64-
2. Run the following commands:
65-
```
66-
$ cd ./src/test-project
67-
$ ./gradlew clean integrationUITestUltimate
68-
```
69-
70-
7162
## Reporting Issues
7263

73-
If you encounter a problem and know it is caused by the IntelliJ IDEA UI test library, please open an [issue report](https://github.com/redhat-developer/intellij-common-ui-test-library/issues). We really do appriciate any relevant issue report containg at least description and steps to reproduce the issue.
64+
If you encounter a problem and know it is caused by the IntelliJ IDEA UI test library, please open an [issue report](https://github.com/redhat-developer/intellij-common-ui-test-library/issues). We really do appreciate any relevant issue report containing at least description and steps to reproduce the issue.
7465

7566

7667
## License

Jenkinsfile

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

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Welcome to the IntelliJ IDEA UI test library project! Here you'll find several pieces of information and advices on how to setup, use and contribute to this library.
1+
Welcome to the IntelliJ IDEA UI test library project! Here you'll find several pieces of information and advices on how to set up, use and contribute to this library.
22

33
## Purpose of this project
44
This project allows you to create automated UI tests for your IntelliJ IDEA plugin project. Using this library you are able to access UI elements such as buttons, inputs, tree elements etc. and perform actions with them. Navigating through wizards, clicking on buttons or editing file content of newly created project could be automated using this library.
@@ -10,17 +10,14 @@ Please submit an [issue](https://github.com/redhat-developer/intellij-common-ui-
1010
Feel free to contribute to this project! See the [contribution guide](https://github.com/redhat-developer/intellij-common-ui-test-library/blob/main/CONTRIBUTING.md) for more details.
1111

1212
## Quick setup
13-
The setup of this library is easy - just extend the **build.gradle** file as described in the following steps and you are ready to write your first UI test.
13+
The setup of this library is easy - just extend the **build.gradle.kts** file as described in the following steps, and you are ready to write your first UI test.
1414

1515
### STEP #1: Adding repositories
1616
You need to add the following nexus and JetBrains repositories:
1717
```
1818
repositories {
1919
maven {
20-
url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
21-
}
22-
maven {
23-
url 'https://repository.jboss.org/nexus/content/groups/public'
20+
url 'https://raw.githubusercontent.com/redhat-developer/intellij-common-ui-test-library/repository/'
2421
}
2522
maven {
2623
url 'https://packages.jetbrains.team/maven/p/ij/intellij-dependencies'
@@ -32,7 +29,7 @@ repositories {
3229
Add the following dependency:
3330
```
3431
dependencies {
35-
compile 'com.redhat.devtools.intellij:intellij-common-ui-test-library:0.4.3'
32+
compile 'com.redhat.devtools.intellij:intellij-common-ui-test-library:0.4.4'
3633
}
3734
```
3835

@@ -43,8 +40,8 @@ sourceSets {
4340
integrationTest {
4441
java.srcDir file('src/it/java')
4542
resources.srcDir file('src/it/resources')
46-
compileClasspath += sourceSets.main.output + configurations.testRuntime
47-
runtimeClasspath += output + compileClasspath
43+
compileClasspath += sourceSets.main.get().compileClasspath + sourceSets.test.get().compileClasspath
44+
runtimeClasspath += output + compileClasspath + sourceSets.test.get().runtimeClasspath
4845
}
4946
}
5047
```
@@ -90,7 +87,7 @@ task integrationTest(type: Test) {
9087
...
9188
}
9289
```
93-
Or add the location as a paramater for gradlew command which runs the test. For example:
90+
Or add the location as a parameter for gradlew command which runs the test. For example:
9491
```
9592
systemProperties['testProjectLocation'] = project.hasProperty('testProjectLocation') ? project.property('testProjectLocation') : null
9693
@@ -127,7 +124,7 @@ public static void closeIde() {
127124
```
128125

129126
## What next? Implement your first UI test!
130-
After you manage to setup this library to your project and successfully start and quit IntelliJ IDEA, there is no more setup needed. Just start writing your UI tests! Here are some examples that will help you get started:
127+
After you manage to set up this library to your project and successfully start and quit IntelliJ IDEA, there is no more setup needed. Just start writing your UI tests! Here are some examples that will help you get started:
131128

132129
### Create your first fixture
133130
Create an instance of a FlatWelcomeFrame class which allows you to access the 'Welcome to IntelliJ IDEA' dialog's UI.

build.gradle.kts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id("java-library")
33
id("maven-publish")
4-
alias(libs.plugins.gradleNexusPublishPlugin)
54
id("jacoco") // Code coverage
65
alias(libs.plugins.sonarqube) // SonarQube
76
}
@@ -88,16 +87,12 @@ publishing {
8887
}
8988
}
9089
}
91-
}
92-
93-
nexusPublishing {
94-
packageGroup.set("JBoss Releases Staging Profile")
9590
repositories {
96-
create("jbossNexus") {
97-
nexusUrl.set(uri("https://repository.jboss.org/nexus/service/local/"))
98-
snapshotRepositoryUrl.set(uri("https://repository.jboss.org/nexus/content/repositories/snapshots/"))
99-
username.set(project.properties["nexusUser"].toString()) // defaults to project.properties["myNexusUsername"]
100-
password.set(project.properties["nexusPassword"].toString()) // defaults to project.properties["myNexusPassword"]
91+
maven {
92+
val baseUrl = layout.buildDirectory.dir("repository/").get()
93+
val releasesRepoUrl = baseUrl.dir("releases")
94+
val snapshotsRepoUrl = baseUrl.dir("snapshots")
95+
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
10196
}
10297
}
10398
}

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
projectVersion=0.4.4-SNAPSHOT
2-
nexusUser=invalid
3-
nexusPassword=invalid
42

53
# Gradle Releases -> https://github.com/gradle/gradle/releases
64
gradleVersion=8.5
5+
6+
# do not verify dependency locally by default. https://docs.gradle.org/current/userguide/dependency_verification.html#sec:disabling-verification
7+
org.gradle.dependency.verification=lenient

gradle/libs.versions.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ kotlin = "2.1.0"
55
junit-jupiter = "5.11.3"
66

77
# plugins
8-
gradleNexusPublishPlugin = "2.0.0"
98
sonarqube = "5.1.0.4882"
109

1110
[libraries]
@@ -15,5 +14,4 @@ remote-robot = { group = "com.intellij.remoterobot", name = "remote-robot", vers
1514
remote-fixtures = { group = "com.intellij.remoterobot", name = "remote-fixtures", version.ref = "remote-robot" }
1615

1716
[plugins]
18-
gradleNexusPublishPlugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradleNexusPublishPlugin" }
1917
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }

0 commit comments

Comments
 (0)