Skip to content
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
Binary file added .github/keys/firebase-sa.json.gpg
Binary file not shown.
Binary file added .github/keys/pub-credentials.json.gpg
Binary file not shown.
46 changes: 46 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run integration tests

on: push

jobs:
build:
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- uses: actions/setup-java@v3
with:
java-version: 8
distribution: zulu

- name: Setup Dart
uses: dart-lang/setup-dart@v1.3

- name: Activate Dart Protoc Plugin
run: dart pub global activate protoc_plugin

- name: Ensure test resource directory exists
run: mkdir ./integration-tests/test-app/src/main/resources/
shell: bash

- name: Decrypt Firebase service account key
run: ./script/decrypt.sh "$FIREBASE_SA_KEY" ./.github/keys/firebase-sa.json.gpg ./integration-tests/test-app/src/main/resources/spine-dev.json
shell: bash
env:
FIREBASE_SA_KEY: ${{ secrets.FIREBASE_SA_KEY }}

- name: Build with gradle
run: ./gradlew build --stacktrace

- name: Run tests
shell: bash
run: ./gradlew integrationTest --stacktrace
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish

on:
push:
branches: [master]


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- uses: actions/setup-java@v3
with:
java-version: 8
distribution: zulu

- name: Setup Dart
uses: dart-lang/setup-dart@v1.3

- name: Activate Dart Protoc Plugin
run: dart pub global activate protoc_plugin

- name: Build with gradle
run: ./gradlew build --stacktrace

- name: Decrypt Pub credentials
run: ./script/decrypt.sh "$PUB_CREDENTIALS_KEY" ./.github/keys/pub-credentials.json.gpg $XDG_CONFIG_HOME/dart/pub-credentials.json
shell: bash
env:
PUB_CREDENTIALS_KEY: ${{ secrets.PUB_CREDENTIALS_KEY }}

- name: Publish to Pub
run: ./gradlew publish -x test --stacktrace
31 changes: 31 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build under Ubuntu

on:
pull_request:
branches:
- master
- 1.x-dev


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- uses: actions/setup-java@v3
with:
java-version: 8
distribution: zulu

- name: Setup Dart
uses: dart-lang/setup-dart@v1.3

- name: Activate Dart Protoc Plugin
run: dart pub global activate protoc_plugin

- name: Build with gradle
run: ./gradlew build --stacktrace
2 changes: 1 addition & 1 deletion .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
run: >
choco install dart-sdk --limitoutput
&& refreshenv
&& pub global activate protoc_plugin
&& dart pub global activate protoc_plugin
&& gradlew.bat build
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

8 changes: 2 additions & 6 deletions buildSrc/src/main/groovy/dart/build-tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import org.apache.tools.ant.taskdefs.condition.Os

final def GROUP = 'Dart'
final def packageIndex = "$projectDir/.packages" as File
final def extension = Os.isFamily(Os.FAMILY_WINDOWS) ? '.bat' : ''
final def PUB_EXECUTABLE = 'pub' + extension

task resolveDependencies(type: Exec) {
group = GROUP
Expand All @@ -38,7 +34,7 @@ task resolveDependencies(type: Exec) {
inputs.file "$projectDir/pubspec.yaml"
outputs.file packageIndex

commandLine PUB_EXECUTABLE, 'get'
commandLine 'dart', 'pub', 'get'

mustRunAfter 'cleanPackageIndex'
}
Expand All @@ -57,7 +53,7 @@ task testDart(type: Exec) {
group = GROUP
description = 'Runs Dart tests declared in the `./test` directory. See `https://pub.dev/packages/test#running-tests`.'

commandLine PUB_EXECUTABLE, 'run', 'test'
commandLine 'dart', 'pub', 'run', 'test'

dependsOn 'resolveDependencies'
}
Expand Down
8 changes: 2 additions & 6 deletions buildSrc/src/main/groovy/dart/pub-publish-tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import org.apache.tools.ant.taskdefs.condition.Os

final def publicationDir = "$buildDir/pub/publication/$project.name"
final def extension = Os.isFamily(Os.FAMILY_WINDOWS) ? '.bat' : ''
final def PUB_EXECUTABLE = 'pub' + extension

task stagePubPublication(type: Copy) {
description = 'Prepares the Dart package for Pub publication.'
Expand All @@ -54,7 +50,7 @@ task publishToPub(type: Exec) {
description = 'Publishes this package to Pub.'

workingDir publicationDir
commandLine PUB_EXECUTABLE, 'publish', '--trace'
commandLine 'dart', 'pub', 'publish', '--trace'
final sayYes = new ByteArrayInputStream('y'.getBytes())
standardInput(sayYes)

Expand All @@ -67,7 +63,7 @@ task publishToPub(type: Exec) {
task activateLocally(type: Exec) {
description = 'Activates this package locally.'

commandLine PUB_EXECUTABLE, 'global', 'activate', '--source', 'path', publicationDir, '--trace'
commandLine 'dart', 'pub', 'global', 'activate', '--source', 'path', publicationDir, '--trace'

workingDir publicationDir
dependsOn 'stagePubPublication'
Expand Down
2 changes: 0 additions & 2 deletions buildSrc/src/main/groovy/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ final def scripts = [
npmPublishTasks : "$dir/js/npm-publish-tasks.gradle",
npmCli : "$dir/js/npm-cli.gradle",
updatePackageVersion : "$dir/js/update-package-version.gradle",
dartBuildTasks : "$dir/dart/build-tasks.gradle",
pubPublishTasks : "$dir/dart/pub-publish-tasks.gradle",
pmd : "$dir/pmd.gradle",
checkstyle : "$dir/checkstyle.gradle",
runBuild : "$dir/run-build.gradle",
Expand Down
9 changes: 6 additions & 3 deletions buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

package io.spine.gradle.internal

import java.net.URI
import org.gradle.api.Project
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.dsl.RepositoryHandler
import java.net.URI

/*
* This file describes shared dependencies of Spine sub-projects.
Expand Down Expand Up @@ -256,6 +256,7 @@ object Test {
object Scripts {

private const val COMMON_PATH = "/config/gradle/"
private const val DART = "/buildSrc/src/main/groovy/dart/"

fun testArtifacts(p: Project) = p.script("test-artifacts.gradle")
fun testOutput(p: Project) = p.script("test-output.gradle")
Expand All @@ -271,8 +272,6 @@ object Scripts {
fun npmPublishTasks(p: Project) = p.script("js/npm-publish-tasks.gradle")
fun npmCli(p: Project) = p.script("js/npm-cli.gradle")
fun updatePackageVersion(p: Project) = p.script("js/update-package-version.gradle")
fun dartBuildTasks(p: Project) = p.script("dart/build-tasks.gradle")
fun pubPublishTasks(p: Project) = p.script("dart/pub-publish-tasks.gradle")
fun pmd(p: Project) = p.script("pmd.gradle")
fun checkstyle(p: Project) = p.script("checkstyle.gradle")
fun runBuild(p: Project) = p.script("run-build.gradle")
Expand All @@ -283,7 +282,11 @@ object Scripts {
fun generatePom(p: Project) = p.script("generate-pom.gradle")
fun updateGitHubPages(p: Project) = p.script("update-gh-pages.gradle")

fun dartBuildTasks(p: Project) = p.dartScript("build-tasks.gradle")
fun pubPublishTasks(p: Project) = p.dartScript("pub-publish-tasks.gradle")

private fun Project.script(name: String) = "${rootDir}$COMMON_PATH$name"
private fun Project.dartScript(name: String) = "${rootDir}$DART$name"
}

object Deps {
Expand Down
2 changes: 0 additions & 2 deletions buildSrc/src/main/kotlin/io/spine/internal/gradle/Scripts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ object Scripts {
fun npmPublishTasks(p: Project) = p.script("js/npm-publish-tasks.gradle")
fun npmCli(p: Project) = p.script("js/npm-cli.gradle")
fun updatePackageVersion(p: Project) = p.script("js/update-package-version.gradle")
fun dartBuildTasks(p: Project) = p.script("dart/build-tasks.gradle")
fun pubPublishTasks(p: Project) = p.script("dart/pub-publish-tasks.gradle")
fun pmd(p: Project) = p.script("pmd.gradle")
fun checkstyle(p: Project) = p.script("checkstyle.gradle")
fun runBuild(p: Project) = p.script("run-build.gradle")
Expand Down
78 changes: 0 additions & 78 deletions client/lib/rest_firebase_client.dart

This file was deleted.

1 change: 0 additions & 1 deletion client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
protobuf: ^2.0.0
http: ^0.13.3
uuid: ^3.0.4
firebase: ^9.0.1
fixnum: ^1.0.0
sprintf: ^6.0.0
optional: ^6.0.0
Expand Down
Binary file removed credentials.tar.enc
Binary file not shown.
4 changes: 1 addition & 3 deletions integration-tests/client-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ tasks["testDart"].enabled = false
val integrationTestDir = "./integration-test"

val integrationTest by tasks.creating(Exec::class) {
val pub = "pub" + if (Os.isFamily(Os.FAMILY_WINDOWS)) ".bat" else ""

// Run tests in Chrome browser because they use a `WebFirebaseClient` which only works in web
// environment.
commandLine(pub, "run", "test", integrationTestDir, "-p", "chrome")
commandLine("dart", "pub", "run", "test", integrationTestDir, "-p", "chrome")

dependsOn("resolveDependencies", ":test-app:appBeforeIntegrationTest")
finalizedBy(":test-app:appAfterIntegrationTest")
Expand Down
Loading