Skip to content

Commit

Permalink
[#5] E2E tests execution using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
szpak committed May 17, 2020
1 parent afe6846 commit 9ae32f0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 13 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: E2E tests

on:
push:
branches:
- master
- "szpak/*"
- "marc/*"

jobs:
gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout project with submodules
uses: actions/checkout@v2
with:
submodules: true
- name: Setup JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Run sanity check
run: ./gradlew --scan --stacktrace test
- name: Run E2E tests
env:
ORG_GRADLE_PROJECT_sonatypeUsernameE2E: ${{ secrets.SONATYPE_USERNAME_E2E }}
ORG_GRADLE_PROJECT_sonatypePasswordE2E: ${{ secrets.SONATYPE_PASSWORD_E2E }}
ORG_GRADLE_PROJECT_signingKeyE2E: ${{ secrets.GPG_SIGNING_KEY_E2E }}
ORG_GRADLE_PROJECT_signingPasswordE2E: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE_E2E }}
run: |
./gradlew --stacktrace --info e2eTest
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/e2eTest/resources/nexus-publish-e2e-minimal"]
path = src/e2eTest/resources/nexus-publish-e2e-minimal
url = git@github.com:gradle-nexus-e2e/nexus-publish-e2e-minimal.git
url = git@github.com:gradle-nexus/nexus-publish-e2e-minimal.git
23 changes: 12 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,24 @@ stutter {
}
}

val e2eTest by sourceSets.creating { //separate infrastructure as compatTest is called multiple times with different Java versions
compileClasspath += sourceSets["compatTest"].output
compileClasspath += sourceSets["main"].output
runtimeClasspath += sourceSets["compatTest"].output
runtimeClasspath += sourceSets["main"].output
}

configurations {
compatTestCompileClasspath {
extendsFrom(testCompileClasspath.get())
}
compatTestRuntimeClasspath {
extendsFrom(testRuntimeClasspath.get())
}
create("e2eTestCompileClasspath") {
configurations.named(e2eTest.implementationConfigurationName) {
extendsFrom(compatTestCompileClasspath.get())
}
create("e2eTestRuntimeClasspath") {
configurations.named(e2eTest.runtimeOnlyConfigurationName) {
extendsFrom(compatTestRuntimeClasspath.get())
}
}
Expand All @@ -126,12 +133,6 @@ sourceSets {
runtimeClasspath += sourceSets["test"].output
runtimeClasspath += sourceSets["main"].output
}
create("e2eTest") { //separate infrastructure as compatTest is called multiple times with different Java versions
compileClasspath += sourceSets["compatTest"].output
compileClasspath += sourceSets["main"].output
runtimeClasspath += sourceSets["compatTest"].output
runtimeClasspath += sourceSets["main"].output
}
}

tasks {
Expand All @@ -157,9 +158,9 @@ tasks {
register<Test>("e2eTest") {
description = "Run E2E tests."
group = "Verification"
testClassesDirs = sourceSets.get("e2eTest").output.classesDirs
classpath = sourceSets.get("e2eTest").runtimeClasspath
listOf("sonatypeUsername", "sonatypePassword", "signing.gnupg.homeDir", "signing.gnupg.keyName", "signing.gnupg.passphrase").forEach {
testClassesDirs = e2eTest.output.classesDirs
classpath = e2eTest.runtimeClasspath
listOf("sonatypeUsername", "sonatypePassword", "signingKey", "signingPassword", "signing.gnupg.homeDir", "signing.gnupg.keyName", "signing.gnupg.passphrase").forEach {
val e2eName = "${it}E2E"
if (project.hasProperty(e2eName)) {
systemProperties.put("org.gradle.project.$e2eName", project.property(e2eName))
Expand Down
2 changes: 1 addition & 1 deletion src/e2eTest/resources/nexus-publish-e2e-minimal

0 comments on commit 9ae32f0

Please sign in to comment.