Skip to content

Commit

Permalink
Add GitHub Actions workflow for CI build and running integration tests
Browse files Browse the repository at this point in the history
The job uses a build matrix for the different device registry
implementations. The jobs are run in parallel on separate VMs.

Signed-off-by: Kai Hudalla <[email protected]>
  • Loading branch information
sophokles73 committed Oct 27, 2020
1 parent 388c791 commit 06b7330
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
#
# This workflow will build all of Hono's components, run unit tests and create
# Docker images. Finally, the integration tests are run.
# The job uses a matrix for the distinct device registry implementations. Thus,
# for each registry implementation, the workflow is run on a separate VM.

name: Build Hono's 'container images and run integration tests

on: [push,pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
device-registry: [file,mongodb]

steps:
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache embedded MongoDB for unit tests
uses: actions/cache@v2
with:
path: ~/.embedmongo/**/*.tgz
key: ${{ runner.os }}-mongodb-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-mongodb-
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build all components ()incl. unit tests) and run integration tests
run: mvn install -B -e -DcreateJavadoc=true -DCI=$CI -Dhono.deviceregistry.type=${{ matrix.device-registry }} -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Pbuild-docker-image,run-tests
12 changes: 10 additions & 2 deletions jmeter/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016, 2018 Contributors to the Eclipse Foundation
Copyright (c) 2016, 2020 Contributors to the Eclipse Foundation
See the NOTICE file(s) distributed with this work for additional
information regarding copyright ownership.
Expand Down Expand Up @@ -29,6 +29,10 @@
<description>JMeter Plugin for Hono with sender and receiver samplers using the Hono Client</description>
<url>https://www.eclipse.org/hono</url>

<properties>
<jmeter.disabled>true</jmeter.disabled>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.jmeter</groupId>
Expand Down Expand Up @@ -80,13 +84,14 @@

<profiles>
<profile>
<id>build-jmeter-image</id>
<id>build-docker-image</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<skipBuild>${jmeter.disabled}</skipBuild>
<images>
<image>
<build>
Expand All @@ -106,6 +111,9 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<skipPush>${jmeter.disabled}</skipPush>
</configuration>
<executions>
<execution>
<id>docker-push-image</id>
Expand Down
6 changes: 6 additions & 0 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ Test cases are run against Docker images of Hono server + (Apache Qpid Dispatch
<profiles>
<profile>
<id>device-registry-mongodb</id>
<activation>
<property>
<name>hono.deviceregistry.type</name>
<value>mongodb</value>
</property>
</activation>
<properties>
<deviceregistry.image>hono-service-device-registry-mongodb</deviceregistry.image>
<hono.mongodb.disabled>false</hono.mongodb.disabled>
Expand Down

0 comments on commit 06b7330

Please sign in to comment.