Merge pull request #635 from wavefrontHQ/shavi-remove-free-trial #326
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
paths: | |
- '.github/workflows/java.yml' | |
- 'java-example/**' | |
- 'java-metric-example/**' | |
jobs: | |
build_and_run_java_app: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
distribution: [ 'temurin' ] | |
java-version: [ '8', '11', '17' ] | |
name: Java ${{ matrix.java-version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JAVA | |
uses: actions/setup-java@v2 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: ${{ matrix.distribution }} | |
cache: maven | |
- name: Build java-metric-example with Maven | |
run: mvn --batch-mode --update-snapshots verify --file java-example/otel-collector/pom.xml | |
- name: Build java-example with Maven | |
run: mvn --batch-mode --update-snapshots verify --file java-example/otel-collector/pom.xml | |
- name: Compile and Run java-example | |
run: | | |
mvn clean compile exec:java -Dexec.mainClass="com.vmware.App" -Dexec.cleanupDaemonThreads=false --file java-example/otel-collector/pom.xml | tee mvn.log | |
- name: Check java-example Output | |
run: | | |
# Get count of unique Trace IDs from output; 'xargs' trims whitespace | |
count=$(grep 'TraceID : ' mvn.log | rev | cut -f1 -d' ' | uniq | wc -l | xargs) | |
if [[ $count -ne 3 ]]; then | |
echo "[ERROR] Wrong TraceID count. Expected: 3. Actual: ${count}." | |
exit 1 | |
fi |