|
15 | 15 | # specific language governing permissions and limitations |
16 | 16 | # under the License. |
17 | 17 |
|
18 | | -# This workflow will build a Java project with Maven |
19 | | -# See also: |
20 | | -# https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
21 | | - |
22 | 18 | name: CI |
23 | 19 |
|
24 | 20 | on: |
25 | 21 | push: |
26 | | - branches: [ '*' ] |
| 22 | + branches: ['develop/**', 'release/**', 'master'] |
27 | 23 | pull_request: |
28 | | - branches: [ '*' ] |
| 24 | + branches: ['develop/**', 'release/**', 'master'] |
| 25 | + |
| 26 | +concurrency: |
| 27 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 28 | + cancel-in-progress: true |
29 | 29 |
|
30 | 30 | jobs: |
31 | | - mvn: |
32 | | - strategy: |
33 | | - matrix: |
34 | | - profile: |
35 | | - - name: 'full-build-jdk8' |
36 | | - jdk: 8 |
37 | | - args: '-Pfull-build apache-rat:check verify -DskipTests spotbugs:check checkstyle:check' |
38 | | - - name: 'full-build-jdk11' |
39 | | - jdk: 11 |
40 | | - args: '-Pfull-build apache-rat:check verify -DskipTests spotbugs:check checkstyle:check' |
41 | | - - name: 'full-build-java-tests' |
42 | | - jdk: 11 |
43 | | - args: '-Pfull-build verify -Dsurefire-forkcount=1 -DskipCppUnit -Dsurefire.rerunFailingTestsCount=5' |
44 | | - - name: 'full-build-cppunit-tests' |
45 | | - jdk: 11 |
46 | | - args: '-Pfull-build verify -Dtest=_ -DfailIfNoTests=false' |
47 | | - fail-fast: false |
48 | | - timeout-minutes: 360 |
49 | | - runs-on: ubuntu-latest |
| 31 | + compile: |
| 32 | + name: Compile + Checkstyle |
| 33 | + runs-on: ubuntu-24.04 |
| 34 | + timeout-minutes: 30 |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - uses: actions/setup-java@v4 |
| 38 | + with: |
| 39 | + java-version: 21 |
| 40 | + distribution: temurin |
| 41 | + cache: maven |
| 42 | + - name: Install C Dependencies |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y libcppunit-dev libsasl2-dev |
| 46 | + - name: Compile and check style |
| 47 | + run: mvn -B -V -e -ntp -Pfull-build verify -DskipTests checkstyle:check |
| 48 | + |
| 49 | + java-tests: |
| 50 | + name: Java Tests |
| 51 | + runs-on: ubuntu-24.04 |
| 52 | + timeout-minutes: 120 |
| 53 | + needs: compile |
50 | 54 | steps: |
51 | 55 | - uses: actions/checkout@v4 |
52 | | - - name: Set up JDK ${{ matrix.profile.jdk }} |
53 | | - uses: actions/setup-java@v4 |
| 56 | + - uses: actions/setup-java@v4 |
54 | 57 | with: |
55 | | - java-version: ${{ matrix.profile.jdk }} |
| 58 | + java-version: 21 |
56 | 59 | distribution: temurin |
57 | | - cache: 'maven' |
58 | | - - name: Show the first log message |
59 | | - run: git log -n1 |
| 60 | + cache: maven |
60 | 61 | - name: Install C Dependencies |
61 | 62 | run: | |
62 | | - sudo apt update |
63 | | - sudo apt install -y libcppunit-dev libsasl2-dev |
64 | | - - name: Build with Maven (${{ matrix.profile.name }}) |
65 | | - run: mvn -B -V -e -ntp "-Dstyle.color=always" ${{ matrix.profile.args }} |
66 | | - env: |
67 | | - MAVEN_OPTS: -Djansi.force=true |
| 63 | + sudo apt-get update |
| 64 | + sudo apt-get install -y libcppunit-dev libsasl2-dev |
| 65 | + - name: Run Java tests |
| 66 | + run: mvn -B -V -e -ntp -Pfull-build verify -Dsurefire-forkcount=1 -DskipCppUnit |
68 | 67 | - name: Upload unit test results |
69 | 68 | if: ${{ failure() }} |
70 | 69 | uses: actions/upload-artifact@v4 |
71 | 70 | with: |
72 | | - name: surefire-reports-${{ matrix.profile.name }} |
| 71 | + name: surefire-reports |
73 | 72 | path: ./**/target/surefire-reports/ |
74 | 73 | if-no-files-found: ignore |
75 | 74 | - name: Upload integration test results |
76 | 75 | if: ${{ failure() }} |
77 | 76 | uses: actions/upload-artifact@v4 |
78 | 77 | with: |
79 | | - name: failsafe-reports-${{ matrix.profile.name }} |
| 78 | + name: failsafe-reports |
80 | 79 | path: ./**/target/failsafe-reports/ |
81 | 80 | if-no-files-found: ignore |
| 81 | + |
| 82 | + c-tests: |
| 83 | + name: C Tests |
| 84 | + runs-on: ubuntu-24.04 |
| 85 | + timeout-minutes: 60 |
| 86 | + needs: compile |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v4 |
| 89 | + - uses: actions/setup-java@v4 |
| 90 | + with: |
| 91 | + java-version: 21 |
| 92 | + distribution: temurin |
| 93 | + cache: maven |
| 94 | + - name: Install C Dependencies |
| 95 | + run: | |
| 96 | + sudo apt-get update |
| 97 | + sudo apt-get install -y libcppunit-dev libsasl2-dev |
| 98 | + - name: Show environment |
| 99 | + run: openssl version && java -version 2>&1 | head -1 |
| 100 | + - name: Run C tests |
| 101 | + run: mvn -B -V -e -ntp -Pfull-build verify -Dtest=_ -Dsurefire.failIfNoSpecifiedTests=false |
82 | 102 | - name: Upload cppunit test logs |
83 | 103 | if: ${{ failure() }} |
84 | 104 | uses: actions/upload-artifact@v4 |
85 | 105 | with: |
86 | | - name: cppunit-logs-${{ matrix.profile.name }} |
| 106 | + name: cppunit-logs |
87 | 107 | path: ./zookeeper-client/zookeeper-client-c/target/c/TEST-*.txt |
88 | 108 | if-no-files-found: ignore |
| 109 | + - name: Upload ZK server logs |
| 110 | + if: ${{ failure() }} |
| 111 | + uses: actions/upload-artifact@v4 |
| 112 | + with: |
| 113 | + name: zk-server-logs |
| 114 | + path: | |
| 115 | + /tmp/zk.log |
| 116 | + /tmp/certs/gencerts.stderr |
| 117 | + if-no-files-found: ignore |
0 commit comments