blob: b72211833b890dcdff49e6069eddcfb8e57bc7bb [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: CI - Unit - Brokers - Broker Group 1
on:
pull_request:
branches:
- master
push:
branches:
- branch-*
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
jobs:
unit-tests:
name:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: checkout
uses: actions/checkout@v2
- name: Changed files check
id: changes
uses: apache/pulsar-test-infra/paths-filter@master
with:
filters: |
# pattern syntax: https://github.com/micromatch/picomatch
all:
- '**'
docs:
- 'site2/**'
- 'deployment/**'
- '.asf.yaml'
- '*.md'
- '**/*.md'
- name: Cache local Maven repository
if: ${{ steps.changes.outputs.all_count > steps.changes.outputs.docs_count }}
uses: actions/cache@v2
with:
path: |
~/.m2/repository/*/*/*
!~/.m2/repository/org/apache/pulsar
key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
if: ${{ steps.changes.outputs.all_count > steps.changes.outputs.docs_count }}
with:
java-version: 1.8
- name: Replace maven's wagon-http version
if: ${{ steps.changes.outputs.all_count > steps.changes.outputs.docs_count }}
run: sudo ./build/replace_maven-wagon-http-version.sh
- name: build modules
if: ${{ steps.changes.outputs.all_count > steps.changes.outputs.docs_count }}
run: mvn -B -ntp -q clean install -Pcore-modules -DskipTests
- name: run unit test 'BROKER_GROUP_1'
if: ${{ steps.changes.outputs.all_count > steps.changes.outputs.docs_count }}
run: ./build/run_unit_group.sh BROKER_GROUP_1
- name: package surefire artifacts
if: failure()
run: |
rm -rf artifacts
mkdir artifacts
find . -type d -name "*surefire*" -exec cp --parents -R {} artifacts/ \;
zip -r artifacts.zip artifacts
- uses: actions/upload-artifact@master
name: upload surefire-artifacts
if: failure()
with:
name: surefire-artifacts
path: artifacts.zip