Update versions and add gitea workflow
All checks were successful
Tests / reset-status (push) Successful in 3s
Tests / tests (push) Successful in 8m27s
Tests / integration-tests (push) Successful in 5m14s
Tests / build (push) Successful in 6m18s

This commit is contained in:
karthik 2023-10-29 17:08:56 +01:00
parent 6ce4437766
commit 9e90c73de1
6 changed files with 370 additions and 260 deletions

View File

@ -0,0 +1,105 @@
name: Tests
on: [push]
jobs:
reset-status:
runs-on: ubuntu-latest
steps:
- name: Reset test status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/tests","status":"starting"}'
- name: Reset integration test status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/integration-tests","status":"waiting for test"}'
- name: Reset build status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/build","status":"waiting for integration test"}'
tests:
needs: reset-status
runs-on: ubuntu-latest
steps:
- name: Set test running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/tests","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run tests
id: tests
run: ./gradlew test
- name: Publish test status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/tests","status":"${{ steps.tests.conclusion }}"}'
integration-tests:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set integration test running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/integration-tests","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run integration tests
id: integration-tests
run: ./gradlew integrationTest
- name: Publish integration test status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/integration-tests","status":"${{ steps.integration-tests.conclusion }}"}'
build:
needs: integration-tests
runs-on: ubuntu-latest
steps:
- name: Set build running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/build","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build
id: build
run: ./gradlew build -x check
- name: Publish build status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/build","status":"${{ steps.build.conclusion }}"}'

View File

@ -1,3 +1,7 @@
[![Tests](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/apache-beam-examples/tests)](https://git.barrelsofdata.com/barrelsofdata/apache-beam-examples/actions?workflow=workflow.yaml)
[![Integration tests](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/apache-beam-examples/integration-tests)](https://git.barrelsofdata.com/barrelsofdata/apache-beam-examples/actions?workflow=workflow.yaml)
[![Build](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/apache-beam-examples/build)](https://git.barrelsofdata.com/barrelsofdata/apache-beam-examples/actions?workflow=workflow.yaml)
# Apache Beam Examples # Apache Beam Examples
This project holds all the examples of apache beam that are detailed on my blog at [https://barrelsofdata.com](https://barrelsofdata.com) This project holds all the examples of apache beam that are detailed on my blog at [https://barrelsofdata.com](https://barrelsofdata.com)

View File

@ -1,13 +1,13 @@
[versions] [versions]
apache-beam = "2.49.0" apache-beam = "2.51.0"
apache-kafka = "3.3.2" apache-kafka = "3.3.2"
h2-database = "2.2.220" h2-database = "2.2.224"
hamcrest = "2.2" hamcrest = "2.2"
jackson = "2.15.2" jackson = "2.15.3"
java = "17" java = "17"
junit-jupiter = "5.9.3" junit-jupiter = "5.10.0"
postgresql-driver = "42.6.0" postgresql-driver = "42.6.0"
spring-kafka-test = "3.0.9" spring-kafka-test = "3.0.12"
[libraries] [libraries]
beam-core = { module = "org.apache.beam:beam-sdks-java-core", version.ref = "apache-beam" } beam-core = { module = "org.apache.beam:beam-sdks-java-core", version.ref = "apache-beam" }

Binary file not shown.

View File

@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

497
gradlew vendored
View File

@ -1,248 +1,249 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# https://www.apache.org/licenses/LICENSE-2.0 # https://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
############################################################################## ##############################################################################
# #
# Gradle start up script for POSIX generated by Gradle. # Gradle start up script for POSIX generated by Gradle.
# #
# Important for running: # Important for running:
# #
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or # noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole # bash, then to run this script, type that shell name before the whole
# command line, like: # command line, like:
# #
# ksh Gradle # ksh Gradle
# #
# Busybox and similar reduced shells will NOT work, because this script # Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features: # requires all of these POSIX shell features:
# * functions; # * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»; # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»; # * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit». # * various built-in commands including «command», «set», and «ulimit».
# #
# Important for patching: # Important for patching:
# #
# (2) This script targets any POSIX shell, so it avoids extensions provided # (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided. # by Bash, Ksh, etc; in particular arrays are avoided.
# #
# The "traditional" practice of packing multiple parameters into a # The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security # space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating # problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java. # options in "$@", and eventually passing that to Java.
# #
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details. # see the in-line comments for details.
# #
# There are tweaks for specific operating systems such as AIX, CygWin, # There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
# #
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
app_path=$0 app_path=$0
# Need this for daisy-chained symlinks. # Need this for daisy-chained symlinks.
while while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ] [ -h "$app_path" ]
do do
ls=$( ls -ld "$app_path" ) ls=$( ls -ld "$app_path" )
link=${ls#*' -> '} link=${ls#*' -> '}
case $link in #( case $link in #(
/*) app_path=$link ;; #( /*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;; *) app_path=$APP_HOME$link ;;
esac esac
done done
# This is normally unused # This is normally unused
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*" warn () {
} >&2 echo "$*"
} >&2
die () {
echo die () {
echo "$*" echo
echo echo "$*"
exit 1 echo
} >&2 exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false # OS specific support (must be 'true' or 'false').
msys=false cygwin=false
darwin=false msys=false
nonstop=false darwin=false
case "$( uname )" in #( nonstop=false
CYGWIN* ) cygwin=true ;; #( case "$( uname )" in #(
Darwin* ) darwin=true ;; #( CYGWIN* ) cygwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #( Darwin* ) darwin=true ;; #(
NONSTOP* ) nonstop=true ;; MSYS* | MINGW* ) msys=true ;; #(
esac NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then # Determine the Java command to use to start the JVM.
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -n "$JAVA_HOME" ] ; then
# IBM's JDK on AIX uses strange locations for the executables if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
JAVACMD=$JAVA_HOME/jre/sh/java # IBM's JDK on AIX uses strange locations for the executables
else JAVACMD=$JAVA_HOME/jre/sh/java
JAVACMD=$JAVA_HOME/bin/java else
fi JAVACMD=$JAVA_HOME/bin/java
if [ ! -x "$JAVACMD" ] ; then fi
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." Please set the JAVA_HOME variable in your environment to match the
fi location of your Java installation."
else fi
JAVACMD=java else
if ! command -v java >/dev/null 2>&1 JAVACMD=java
then if ! command -v java >/dev/null 2>&1
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." Please set the JAVA_HOME variable in your environment to match the
fi location of your Java installation."
fi fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then # Increase the maximum file descriptors if we can.
case $MAX_FD in #( if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
max*) case $MAX_FD in #(
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. max*)
# shellcheck disable=SC3045 # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD=$( ulimit -H -n ) || # shellcheck disable=SC2039,SC3045
warn "Could not query maximum file descriptor limit" MAX_FD=$( ulimit -H -n ) ||
esac warn "Could not query maximum file descriptor limit"
case $MAX_FD in #( esac
'' | soft) :;; #( case $MAX_FD in #(
*) '' | soft) :;; #(
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. *)
# shellcheck disable=SC3045 # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
ulimit -n "$MAX_FD" || # shellcheck disable=SC2039,SC3045
warn "Could not set maximum file descriptor limit to $MAX_FD" ulimit -n "$MAX_FD" ||
esac warn "Could not set maximum file descriptor limit to $MAX_FD"
fi esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line # Collect all arguments for the java command, stacking in reverse order:
# * the main class name # * args from the command line
# * -classpath # * the main class name
# * -D...appname settings # * -classpath
# * --module-path (only if needed) # * -D...appname settings
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then # For Cygwin or MSYS, switch paths to Windows format before running java
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) if "$cygwin" || "$msys" ; then
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do # Now convert the arguments - kludge to limit ourselves to /bin/sh
if for arg do
case $arg in #( if
-*) false ;; # don't mess with options #( case $arg in #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath -*) false ;; # don't mess with options #(
[ -e "$t" ] ;; #( /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
*) false ;; [ -e "$t" ] ;; #(
esac *) false ;;
then esac
arg=$( cygpath --path --ignore --mixed "$arg" ) then
fi arg=$( cygpath --path --ignore --mixed "$arg" )
# Roll the args list around exactly as many times as the number of fi
# args, so each arg winds up back in the position where it started, but # Roll the args list around exactly as many times as the number of
# possibly modified. # args, so each arg winds up back in the position where it started, but
# # possibly modified.
# NB: a `for` loop captures its iteration list before it begins, so #
# changing the positional parameters here affects neither the number of # NB: a `for` loop captures its iteration list before it begins, so
# iterations, nor the values presented in `arg`. # changing the positional parameters here affects neither the number of
shift # remove old arg # iterations, nor the values presented in `arg`.
set -- "$@" "$arg" # push replacement arg shift # remove old arg
done set -- "$@" "$arg" # push replacement arg
fi done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # Collect all arguments for the java command:
# shell script including quotes and variable substitutions, so put them in # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# double quotes to make sure that they get re-expanded; and # and any embedded shellness will be escaped.
# * put everything else in single quotes, so that it's not re-expanded. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ set -- \
-classpath "$CLASSPATH" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
org.gradle.wrapper.GradleWrapperMain \ -classpath "$CLASSPATH" \
"$@" org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1 # Stop when "xargs" is not available.
then if ! command -v xargs >/dev/null 2>&1
die "xargs is not available" then
fi die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
# # Use "xargs" to parse quoted args.
# With -n1 it outputs one arg per line, with the quotes and backslashes removed. #
# # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
# In Bash we could simply go: #
# # In Bash we could simply go:
# readarray ARGS < <( xargs -n1 <<<"$var" ) && #
# set -- "${ARGS[@]}" "$@" # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# # set -- "${ARGS[@]}" "$@"
# but POSIX shell has neither arrays nor command substitution, so instead we #
# post-process each arg (as a line of input to sed) to backslash-escape any # but POSIX shell has neither arrays nor command substitution, so instead we
# character that might be a shell metacharacter, then use eval to reverse # post-process each arg (as a line of input to sed) to backslash-escape any
# that process (while maintaining the separation between arguments), and wrap # character that might be a shell metacharacter, then use eval to reverse
# the whole thing up as a single "set" statement. # that process (while maintaining the separation between arguments), and wrap
# # the whole thing up as a single "set" statement.
# This will of course break if any of these variables contains a newline or #
# an unmatched quote. # This will of course break if any of these variables contains a newline or
# # an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | eval "set -- $(
xargs -n1 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | xargs -n1 |
tr '\n' ' ' sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
)" '"$@"' tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"