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

GEOMESA-3396 CI - Split up unit tests into different workflows #3171

Merged
merged 15 commits into from
Sep 18, 2024
53 changes: 10 additions & 43 deletions .github/workflows/build-and-test-2.12.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,19 @@
name: build-and-test-2.12
name: scala-2.12

on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
tags:
- '**'
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

env:
MAVEN_CLI_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dlicense.skip=true --batch-mode
MAVEN_TEST_OPTS: -Dtest.fork.count=1

jobs:
build-scala:
runs-on: ubuntu-latest
# avoid duplicate jobs on PRs from the main repo
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Build with Maven
run: ./build/mvn clean install $MAVEN_CLI_OPTS -DskipTests -T4
- name: Unit tests
id: test
continue-on-error: true
run: |
set -o pipefail
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS | tee -a test.log
- name: Unit tests (retry)
id: test-retry
if: steps.test.outcome=='failure'
continue-on-error: true
run: |
set -o pipefail
RESUME_FROM="$(grep --text 'mvn <args> -rf ' test.log | tail -n1 | sed 's/.*-rf/-rf/')"
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS $RESUME_FROM | tee -a test.log
- name: Unit tests (retry)
id: test-retry-retry
if: steps.test-retry.outcome=='failure'
run: |
set -o pipefail
RESUME_FROM="$(grep --text 'mvn <args> -rf ' test.log | tail -n1 | sed 's/.*-rf/-rf/')"
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS $RESUME_FROM | tee -a test.log
- name: Remove geomesa artifacts
if: success() || failure()
run: rm -rf ~/.m2/repository/org/locationtech/geomesa
build-and-test:
uses: ./.github/workflows/build-and-test.yml
with:
scala-version: "2.12"
55 changes: 10 additions & 45 deletions .github/workflows/build-and-test-2.13.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,19 @@
name: build-and-test-2.13
name: scala-2.13

on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
tags:
- '**'
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

env:
MAVEN_CLI_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dlicense.skip=true --batch-mode
MAVEN_TEST_OPTS: -Dtest.fork.count=1

jobs:
build-scala:
runs-on: ubuntu-latest
# avoid duplicate jobs on PRs from the main repo
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Set Scala version
run: ./build/scripts/change-scala-version.sh 2.13
- name: Build with Maven
run: ./build/mvn clean install $MAVEN_CLI_OPTS -DskipTests -T4
- name: Unit tests
id: test
continue-on-error: true
run: |
set -o pipefail
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS | tee -a test.log
- name: Unit tests (retry)
id: test-retry
if: steps.test.outcome=='failure'
continue-on-error: true
run: |
set -o pipefail
RESUME_FROM="$(grep --text 'mvn <args> -rf ' test.log | tail -n1 | sed 's/.*-rf/-rf/')"
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS $RESUME_FROM | tee -a test.log
- name: Unit tests (retry)
id: test-retry-retry
if: steps.test-retry.outcome=='failure'
run: |
set -o pipefail
RESUME_FROM="$(grep --text 'mvn <args> -rf ' test.log | tail -n1 | sed 's/.*-rf/-rf/')"
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS $RESUME_FROM | tee -a test.log
- name: Remove geomesa artifacts
if: success() || failure()
run: rm -rf ~/.m2/repository/org/locationtech/geomesa
build-and-test:
uses: ./.github/workflows/build-and-test.yml
with:
scala-version: "2.13"
159 changes: 159 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: build-and-test

on:
workflow_call:
inputs:
scala-version:
required: false
type: string
default: "2.12"

permissions: # added using https://github.com/step-security/secure-repo
contents: read

env:
MAVEN_CLI_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dlicense.skip=true --batch-mode
MAVEN_TEST_OPTS: -Dtest.fork.count=1

jobs:
build-scala:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Set Scala version
run: ./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
- name: Build with Maven
run: ./build/mvn clean install $MAVEN_CLI_OPTS -DskipTests -T4
- name: Collect artifacts
run: |
mv ~/.m2/repository/org/locationtech/geomesa m2-geomesa
tar -czf classes.tgz $(find . -path '*/target/classes' -o -path '*/target/test-classes' -type d | tr '\n' ' ')
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: classes-and-jars
retention-days: 1
path: |
m2-geomesa
classes.tgz
- name: Remove geomesa artifacts
if: success() || failure()
run: rm -rf ~/.m2/repository/org/locationtech/geomesa
accumulo-ds-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -pl :geomesa-accumulo-datastore_${{ inputs.scala-version }}
scala-version: ${{ inputs.scala-version }}
accumulo-other-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-accumulo -pl -:geomesa-accumulo-datastore_${{ inputs.scala-version }}
scala-version: ${{ inputs.scala-version }}
arrow-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-arrow
scala-version: ${{ inputs.scala-version }}
cassandra-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-cassandra
scala-version: ${{ inputs.scala-version }}
convert-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-convert
scala-version: ${{ inputs.scala-version }}
cqengine-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-memory
scala-version: ${{ inputs.scala-version }}
features-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-features
scala-version: ${{ inputs.scala-version }}
fs-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-fs
scala-version: ${{ inputs.scala-version }}
gt-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-gt
scala-version: ${{ inputs.scala-version }}
hbase-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-hbase
scala-version: ${{ inputs.scala-version }}
kafka-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-kafka
scala-version: ${{ inputs.scala-version }}
lambda-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-lambda
scala-version: ${{ inputs.scala-version }}
metrics-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-metrics
scala-version: ${{ inputs.scala-version }}
process-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-process
scala-version: ${{ inputs.scala-version }}
redis-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-redis
scala-version: ${{ inputs.scala-version }}
spark-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-spark
scala-version: ${{ inputs.scala-version }}
utils-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -f geomesa-utils-parent
scala-version: ${{ inputs.scala-version }}
other-tests:
needs: build-scala
uses: ./.github/workflows/unit-tests.yml
with:
module-selector: -pl geomesa-filter,geomesa-index-api,geomesa-jobs,geomesa-security,geomesa-tools,geomesa-z3
scala-version: ${{ inputs.scala-version }}
integration-tests:
needs: build-scala
uses: ./.github/workflows/integration-tests.yml
with:
scala-version: ${{ inputs.scala-version }}
8 changes: 5 additions & 3 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: build-docs

on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
tags:
- '**'
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
Expand All @@ -13,9 +18,6 @@ env:
jobs:
build-docs:
runs-on: ubuntu-latest
# avoid duplicate jobs on PRs from the main repo
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ name: Codacy Security Scan

on:
push:
branches: [ main ]
branches:
- main
- '[0-9]+.[0-9]+.x'
tags:
- '**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '20 21 * * 4'

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/eclipse-dash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: eclipse-dash

on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
tags:
- '**'
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
Expand All @@ -13,9 +18,6 @@ env:
jobs:
license-check:
runs-on: ubuntu-latest
# avoid duplicate jobs on PRs from the main repo
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/integration-tests-2.12.yml

This file was deleted.

Loading
Loading