Skip to content
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

Feature: gRPC Web #9

Merged
merged 1 commit into from
Jun 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 0 additions & 14 deletions .github/pr-badge.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
## PR Size
- label: "PR Size"
message: "Large"
color: "red"
when: "$additions > 5000"
- label: "PR Size"
message: "Medium"
color: "yellow"
when: "$additions > 1000"
- label: "PR Size"
message: "Small"
color: "green"
when: "$additions < 1000"

## Draft/ready for review
- label: "Status"
message: "Draft"
Expand Down
101 changes: 69 additions & 32 deletions .github/workflows/build.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
checks: 'write'
pull-requests: 'write'

defaults:
run:
Expand All @@ -53,7 +55,7 @@ jobs:
java-version: '11'

## Setup: GraalVM
- uses: DeLaGuardo/setup-graalvm@5.0
- uses: elide-tools/setup-graalvm@5.0
with:
graalvm: '21.0.0.2'
java: 'java11'
Expand All @@ -79,6 +81,7 @@ jobs:
## CI: Build
- name: "🛠️ Build"
uses: gradle/gradle-build-action@v2
id: gradlebuild
env:
CI: true
with:
Expand All @@ -89,34 +92,19 @@ jobs:
-PbuildSamples=false
-x nativeCompile
-x test
-x koverMergedHtmlReport

## CI: Failure Comment
- name: "Comment: Build Scan (Failure)"
uses: actions/github-script@v6
if: github.event_name == 'pull_request' && failure()
if: github.event_name == 'pull_request' && failure() && contains(matrix.os, 'ubuntu')
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
})

## CI: Success Comment
- name: "Comment: Build Scan (Success)"
uses: actions/github-script@v6
if: github.event_name == 'pull_request' && success()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ ${{ github.workflow }} completed: ${{ steps.gradle.outputs.build-scan-url }}'
body: '❌ ${{ github.workflow }} run failed: ${{ steps.gradlebuild.outputs.build-scan-url }}'
})

##
Expand All @@ -125,7 +113,12 @@ jobs:
tests-jvm:
runs-on: ubuntu-latest
needs: [gradle]
continue-on-error: true # temporary
continue-on-error: true
permissions:
contents: 'read'
id-token: 'write'
checks: 'write'
pull-requests: 'write'
steps:
## Setup: Checkout Code
- uses: actions/checkout@v3
Expand Down Expand Up @@ -157,18 +150,37 @@ jobs:
elide-${{ runner.os }}
elide-

## Run Sonar
## Run JVM Tests
- name: "Run Tests (JVM)"
uses: gradle/gradle-build-action@v2
with:
arguments: |
test
:tools:reports:reports
-Pelide.ci=true
-x nativeCompile
-x :packages:graalvm:test
-x :packages:graalvm-js:test
-x :packages:graalvm-react:test

## Collect Reports
- uses: actions/upload-artifact@v3
with:
name: test-reports-jvm
path: |
**/build/reports/jacoco/test/jacocoTestReport.xml
**/build/reports/jacoco/testCodeCoverageReport/jacocoTestReport.xml
**/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
tools/reports/build/reports/**/*.xml
tools/reports/build/test-results/**/*.xml

## Annotate test results
- name: Annotate test results
uses: elide-tools/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'

##
## Job: Testsuite (Native)
##
Expand Down Expand Up @@ -220,22 +232,35 @@ jobs:
elide-${{ runner.os }}
elide-

## Run Sonar
## Run Native Tests
- name: "Run Tests (Native)"
uses: gradle/gradle-build-action@v2
with:
arguments: |
graalvm:test
graalvm-js:test
graalvm-react:test
:tools:reports:reports
-Pelide.ci=true

## Collect Reports
- uses: actions/upload-artifact@v3
with:
name: test-reports-native
path: |
**/build/reports/jacoco/test/jacocoTestReport.xml
**/build/reports/jacoco/testCodeCoverageReport/jacocoTestReport.xml
**/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
tools/reports/build/reports/**/*.xml
tools/reports/build/test-results/**/*.xml


##
## Job: Sonar
##
tools-sonar:
runs-on: ubuntu-latest
needs: [gradle]
needs: [gradle, tests-jvm]
steps:
## Setup: Checkout Code
- uses: actions/checkout@v3
Expand Down Expand Up @@ -275,6 +300,16 @@ jobs:
elide-${{ runner.os }}
elide-

## Download JVM reports
- name: Download JVM test reports
uses: actions/download-artifact@v3
with:
name: test-reports-jvm

## Inflate missing git history
- name: "Inflate Git history"
run: git fetch --unshallow

## Run Sonar
- name: "Run Sonar"
uses: gradle/gradle-build-action@v2
Expand All @@ -297,23 +332,25 @@ jobs:
tools-codecov:
runs-on: ubuntu-latest
needs: [tests-jvm]
if: github.ref == 'refs/heads/non-existent' # disable temporarily
continue-on-error: true
steps:
## Setup: Checkout Code
- uses: actions/checkout@v3

## Download coverage reports (TBD)
## Download JVM reports
- name: Download JVM test reports
uses: actions/download-artifact@v3
with:
name: test-reports-jvm

## Upload to Codecov
## Upload to Codecov (JVM)
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage1.xml,./coverage2.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

token: ${{ secrets.CODECOV_TOKEN }}
files: ./tools/reports/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
name: jvm
fail_ci_if_error: false
verbose: true

##
## Job: Docker Samples (JVM)
Expand Down
17 changes: 17 additions & 0 deletions .run/Testsuite (JVM).run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Testsuite (JVM)" type="JUnit" factoryName="JUnit">
<extension name="coverage" sample_coverage="false" runner="jacoco" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="graalvm-11" />
<option name="PACKAGE_NAME" value="elide" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="wholeProject" />
</option>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ clean: ## Clean build outputs and caches.

docs: $(DOCS) ## Generate docs for all library modules.
@echo "Generating docs..."
$(CMD)$(RM) -fr$(POSIX_FLAGS) docs/kotlin docs/reports
$(CMD)$(GRADLE) docs $(_ARGS)
$(CMD)$(MKDIR) -p $(DOCS)
$(CMD)cd $(TARGET)/docs && $(CP) -fr$(POSIX_FLAGS) ./* $(PWD)/docs/
Expand All @@ -106,15 +107,14 @@ docs: $(DOCS) ## Generate docs for all library modules.
reports: ## Generate reports for tests, coverage, etc.
@echo "Generating reports..."
$(CMD)$(GRADLE) \
koverMergedHtmlReport \
koverMergedXmlReport \
:tools:reports:reports \
-x nativeCompile \
-x test
$(CMD)$(MKDIR) -p $(REPORTS)
$(CMD)$(MKDIR) -p $(REPORTS) $(TARGET)/reports
@echo "Copying merged reports to '$(REPORTS)'..."
$(CMD)cd $(TARGET)/reports && $(CP) -fr$(POSIX_FLAGS) ./* $(REPORTS)/
$(CMD)-cd $(TARGET)/reports && $(CP) -fr$(POSIX_FLAGS) ./* $(REPORTS)/
@echo "Copying test reports to '$(REPORTS)'..."
$(CMD)$(MKDIR) -p tools/reports/build/reports
$(CMD)cd tools/reports/build/reports && $(CP) -fr$(POSIX_FLAGS) ./* $(REPORTS)/
@echo "Reports synced."

Expand Down
40 changes: 3 additions & 37 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ plugins {
kotlin("plugin.serialization") version "1.7.0" apply false
id("com.google.cloud.artifactregistry.gradle-plugin")
id("org.jetbrains.dokka") version "1.7.0"
id("org.jetbrains.kotlinx.kover") version "0.5.1"
id("org.sonarqube") version "3.4.0.2513"
id("com.github.ben-manes.versions") version "0.42.0"
jacoco
}

group = "dev.elide"
Expand Down Expand Up @@ -56,10 +56,10 @@ buildscript {
classpath("com.bmuschko:gradle-docker-plugin:${Versions.dockerPlugin}")
classpath("com.github.node-gradle:gradle-node-plugin:${Versions.nodePlugin}")
classpath("gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:${Versions.gauthPlugin}")
classpath("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:${Versions.protobufPlugin}")
classpath("io.micronaut.gradle:micronaut-gradle-plugin:${Versions.micronautPlugin}")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${Versions.kotlin}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
classpath("org.jetbrains.kotlinx:kover:${Versions.koverPlugin}")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.atomicfuPlugin}")
classpath("org.jetbrains.kotlinx:kotlinx-benchmark-plugin:${Versions.benchmarkPlugin}")
classpath("com.adarshr:gradle-test-logger-plugin:${Versions.testLoggerPlugin}")
Expand Down Expand Up @@ -105,19 +105,10 @@ subprojects {
val name = this.name

sonarqube {
if (name != "base") {
if (name != "base" && name != "test") {
properties {
property("sonar.sources", "src/main/kotlin")
property("sonar.tests", "src/test/kotlin")
property(
"sonar.coverage.jacoco.xmlReportPaths",
listOf(
"build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml",
"build/reports/jacoco/testCodeCoverageReport/jacocoTestReport.xml",
"build/reports/jacoco/test/jacocoTestReport.xml",
"build/reports/kover/xml/coverage.xml",
)
)
}
} else {
properties {
Expand Down Expand Up @@ -156,28 +147,3 @@ allprojects {
}
}
}

kover {
if (project.hasProperty("elide.ci") && (project.properties["elide.ci"] as String) == "true") {
coverageEngine.set(kotlinx.kover.api.CoverageEngine.JACOCO)
} else {
coverageEngine.set(kotlinx.kover.api.CoverageEngine.INTELLIJ)
}
}

tasks.koverMergedHtmlReport {
isEnabled = true
htmlReportDir.set(layout.buildDirectory.dir("${rootProject.buildDir}/reports/kover/html"))
}

tasks.koverMergedXmlReport {
isEnabled = true
xmlReportFile.set(layout.buildDirectory.file("${rootProject.buildDir}/reports/kover/xml/coverage.xml"))
}

subprojects {
tasks.koverXmlReport {
isEnabled = true
xmlReportFile.set(layout.buildDirectory.file("${project.buildDir}/reports/kover/xml/coverage.xml"))
}
}
3 changes: 3 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ val atomicFuPluginVersion = "0.18.0"
val dockerPluginVersion = "7.4.0"
val nodePluginVersion = "3.3.0"
val gauthPlugin = "2.1.5"
val kotestVersion = "5.3.1"
val protobufPluginVersion = "0.8.18"

plugins {
`kotlin-dsl`
Expand All @@ -18,6 +20,7 @@ dependencies {
api("com.github.node-gradle:gradle-node-plugin:$nodePluginVersion")
implementation("com.bmuschko:gradle-docker-plugin:$dockerPluginVersion")
implementation("gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:$gauthPlugin")
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicFuPluginVersion")
implementation("io.micronaut.gradle:micronaut-gradle-plugin:$micronautPluginVersion")
Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ object Versions {
const val kotlinSerialization = "1.3.3"
const val kotlinxHtml = "0.7.5"
const val javaLanguage = "11"
const val kotest = "5.3.2"
const val micronaut = "3.5.2"
const val micronautPlugin = "3.4.1"
const val micronautKotlin = "3.2.2"
Expand All @@ -17,12 +18,12 @@ object Versions {
const val grpc = "1.46.0"
const val grpcKotlin = "1.3.0"
const val protobuf = "3.20.1"
const val protobufPlugin = "0.8.18"
const val netty = "4.1.72.Final"
const val tcNative = "2.0.46.Final"
const val atomicfu = "1.7.0"
const val atomicfuPlugin = "0.18.0"
const val benchmarkPlugin = "0.4.2"
const val koverPlugin = "0.5.1"
const val graalvm = "22.1.0"
const val guava = "31.1-jre"
const val react = "18.2.0"
Expand All @@ -40,4 +41,5 @@ object Versions {
const val testLoggerPlugin = "3.2.0"
const val versionsPlugin = "0.42.0"
const val logbackClassic = "1.2.11"
const val antJUnit = "1.10.12"
}
Loading