2021-06-17 11:34:06 +08:00
|
|
|
# This workflow will build a Java project with Maven
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
|
|
|
2023-03-02 10:43:08 +08:00
|
|
|
name: "Continuous Integration"
|
2021-06-17 11:34:06 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master, develop, v1.x-develop, v1.X ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ develop, v1.x-develop ]
|
|
|
|
|
2022-09-26 10:34:33 +08:00
|
|
|
permissions:
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
|
2021-06-17 11:34:06 +08:00
|
|
|
jobs:
|
2023-03-02 10:43:08 +08:00
|
|
|
ci:
|
2021-06-17 11:34:06 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-06-17 11:51:56 +08:00
|
|
|
os: [ubuntu-latest]
|
2021-06-18 17:49:51 +08:00
|
|
|
java: [8]
|
2021-06-17 11:34:06 +08:00
|
|
|
steps:
|
2023-03-02 10:43:08 +08:00
|
|
|
- name: "Cache Maven Repos"
|
2022-11-30 09:27:20 +08:00
|
|
|
uses: actions/cache@v3
|
2021-06-17 11:34:06 +08:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
2023-03-02 10:43:08 +08:00
|
|
|
- name: "Checkout"
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: "Set up JDK ${{ matrix.java }}"
|
2022-11-30 09:27:20 +08:00
|
|
|
uses: actions/setup-java@v3
|
2021-06-17 11:34:06 +08:00
|
|
|
with:
|
|
|
|
java-version: ${{ matrix.java }}
|
2022-11-30 09:27:20 +08:00
|
|
|
distribution: 'zulu'
|
|
|
|
architecture: x64
|
2023-03-02 10:43:08 +08:00
|
|
|
- name: "Print maven version"
|
|
|
|
run: mvn -version
|
|
|
|
- name: "Check with Maven"
|
|
|
|
run: mvn -B clean package apache-rat:check findbugs:findbugs -DskipTests -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
|
|
|
- name: "Build with Maven"
|
|
|
|
run: mvn -Prelease-nacos -DskipTests clean install -U -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
|
|
|
- name: "Test With Maven"
|
|
|
|
run: mvn -Prelease-nacos clean test -DtrimStackTrace=false -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
|
|
|
- name: "Codecov"
|
2024-05-20 14:32:43 +08:00
|
|
|
uses: codecov/codecov-action@v4.0.1
|
2022-05-11 16:20:28 +08:00
|
|
|
with:
|
2024-04-23 10:24:38 +08:00
|
|
|
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./config/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./logger-adapter-impl/log4j2-adapter/target/site/jacoco/jacoco.xml,./logger-adapter-impl/logback-adapter-12/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./persistence/target/site/jacoco/jacoco.xml,./plugin-default-impl/nacos-default-auth-plugin/target/site/jacoco/jacoco.xml,./plugin-default-impl/nacos-default-control-plugin/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/config/target/site/jacoco/jacoco.xml,./plugin/control/target/site/jacoco/jacoco.xml,./plugin/datasource/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./plugin/environment/target/site/jacoco/jacoco.xml,./plugin/trace/target/site/jacoco/jacoco.xml,./prometheus/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
|
2024-05-20 14:32:43 +08:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|