|
13 | 13 | # See the License for the specific language governing permissions and |
14 | 14 | # limitations under the License. |
15 | 15 | # |
16 | | -# This workflow will build a Java project with Maven |
17 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
18 | 16 |
|
19 | 17 | name: build |
20 | 18 |
|
|
25 | 23 | branches: [ main ] |
26 | 24 |
|
27 | 25 | jobs: |
28 | | - build: |
| 26 | + compile-matrix: |
29 | 27 | runs-on: ubuntu-latest |
30 | 28 | strategy: |
31 | 29 | matrix: |
32 | 30 | jdk: [8, 11, 17] |
33 | 31 | steps: |
34 | | - - uses: actions/checkout@v2 |
| 32 | + - uses: actions/checkout@v4 |
35 | 33 | - name: Set up JDK |
36 | | - uses: actions/setup-java@v1 |
| 34 | + uses: actions/setup-java@v4 |
37 | 35 | with: |
| 36 | + distribution: temurin |
38 | 37 | java-version: ${{ matrix.jdk }} |
39 | 38 | - name: Cache Maven packages |
40 | 39 | uses: actions/cache@v4 |
41 | 40 | with: |
42 | 41 | path: ~/.m2/repository |
43 | | - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 42 | + key: ${{ runner.os }}-maven-compile-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }} |
44 | 43 | restore-keys: | |
| 44 | + ${{ runner.os }}-maven-compile-${{ matrix.jdk }}- |
45 | 45 | ${{ runner.os }}-maven- |
46 | | - - name: JDK 8 |
47 | | - if: matrix.jdk == '8' |
48 | | - run: mvn -B clean package -P travis jacoco:report -Dmaven.gitcommitid.skip=true |
49 | | - - name: JDK 11 |
50 | | - if: matrix.jdk == '11' |
51 | | - run: mvn -B clean compile -Dmaven.gitcommitid.skip=true |
52 | | - - name: JDK 17 |
53 | | - if: matrix.jdk == '17' |
| 46 | + - name: Compile |
54 | 47 | run: mvn -B clean compile -Dmaven.gitcommitid.skip=true |
| 48 | + |
| 49 | + unit-integration-pr: |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + - name: Set up JDK 8 |
| 54 | + uses: actions/setup-java@v4 |
| 55 | + with: |
| 56 | + distribution: temurin |
| 57 | + java-version: 8 |
| 58 | + - name: Cache Maven packages |
| 59 | + uses: actions/cache@v4 |
| 60 | + with: |
| 61 | + path: ~/.m2/repository |
| 62 | + key: ${{ runner.os }}-maven-unit-integration-${{ hashFiles('**/pom.xml') }} |
| 63 | + restore-keys: | |
| 64 | + ${{ runner.os }}-maven-unit-integration- |
| 65 | + ${{ runner.os }}-maven- |
| 66 | + - name: Run unit and integration tests |
| 67 | + run: | |
| 68 | + mvn -B clean test -P travis jacoco:report \ |
| 69 | + -Dmaven.gitcommitid.skip=true |
55 | 70 | - name: Upload coverage to Codecov |
56 | | - if: matrix.jdk == '8' |
57 | | - uses: codecov/codecov-action@v1 |
| 71 | + uses: codecov/codecov-action@v4 |
| 72 | + with: |
| 73 | + files: ${{ github.workspace }}/apollo-*/target/site/jacoco/jacoco.xml |
| 74 | + |
| 75 | + compat-api: |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + - name: Set up JDK 8 |
| 80 | + uses: actions/setup-java@v4 |
| 81 | + with: |
| 82 | + distribution: temurin |
| 83 | + java-version: 8 |
| 84 | + - name: Cache Maven packages |
| 85 | + uses: actions/cache@v4 |
58 | 86 | with: |
59 | | - file: ${{ github.workspace }}/apollo-*/target/site/jacoco/jacoco.xml |
| 87 | + path: ~/.m2/repository |
| 88 | + key: ${{ runner.os }}-maven-compat-api-${{ hashFiles('**/pom.xml') }} |
| 89 | + restore-keys: | |
| 90 | + ${{ runner.os }}-maven-compat-api- |
| 91 | + ${{ runner.os }}-maven- |
| 92 | + - name: Build local artifacts for api compatibility |
| 93 | + run: | |
| 94 | + mvn -B -pl apollo-core,apollo-client,apollo-mockserver -am \ |
| 95 | + -DskipTests install -Dmaven.gitcommitid.skip=true |
| 96 | + - name: Run api compatibility tests |
| 97 | + run: | |
| 98 | + mvn -B -f apollo-compat-tests/pom.xml -pl apollo-api-compat-it \ |
| 99 | + test -Dmaven.gitcommitid.skip=true |
| 100 | +
|
| 101 | + compat-spring: |
| 102 | + runs-on: ubuntu-latest |
| 103 | + strategy: |
| 104 | + matrix: |
| 105 | + include: |
| 106 | + - name: spring-3.1.1-jdk8 |
| 107 | + java: 8 |
| 108 | + spring_framework: 3.1.1.RELEASE |
| 109 | + java_version_prop: 1.8 |
| 110 | + - name: spring-6.1-jdk17 |
| 111 | + java: 17 |
| 112 | + spring_framework: 6.1.18 |
| 113 | + java_version_prop: 17 |
| 114 | + name: compat-spring-${{ matrix.name }} |
| 115 | + steps: |
| 116 | + - uses: actions/checkout@v4 |
| 117 | + - name: Set up JDK |
| 118 | + uses: actions/setup-java@v4 |
| 119 | + with: |
| 120 | + distribution: temurin |
| 121 | + java-version: ${{ matrix.java }} |
| 122 | + - name: Cache Maven packages |
| 123 | + uses: actions/cache@v4 |
| 124 | + with: |
| 125 | + path: ~/.m2/repository |
| 126 | + key: ${{ runner.os }}-maven-compat-spring-${{ matrix.name }}-${{ hashFiles('**/pom.xml') }} |
| 127 | + restore-keys: | |
| 128 | + ${{ runner.os }}-maven-compat-spring-${{ matrix.name }}- |
| 129 | + ${{ runner.os }}-maven- |
| 130 | + - name: Build local artifacts for compat tests |
| 131 | + run: | |
| 132 | + mvn -B -pl apollo-core,apollo-client,apollo-mockserver -am \ |
| 133 | + -DskipTests install -Dmaven.gitcommitid.skip=true |
| 134 | + - name: Run spring compatibility tests |
| 135 | + run: | |
| 136 | + mvn -B -f apollo-compat-tests/pom.xml -pl apollo-spring-compat-it \ |
| 137 | + -Dspring.framework.version=${{ matrix.spring_framework }} \ |
| 138 | + -Djava.version=${{ matrix.java_version_prop }} \ |
| 139 | + test -Dmaven.gitcommitid.skip=true |
| 140 | +
|
| 141 | + compat-spring-boot: |
| 142 | + runs-on: ubuntu-latest |
| 143 | + strategy: |
| 144 | + matrix: |
| 145 | + include: |
| 146 | + - name: spring-boot-2.7-jdk8 |
| 147 | + java: 8 |
| 148 | + spring_boot: 2.7.18 |
| 149 | + java_version_prop: 1.8 |
| 150 | + compat_slf4j: 1.7.36 |
| 151 | + compat_vintage: 5.7.0 |
| 152 | + - name: spring-boot-3.3-jdk17 |
| 153 | + java: 17 |
| 154 | + spring_boot: 3.3.10 |
| 155 | + java_version_prop: 17 |
| 156 | + compat_slf4j: 2.0.17 |
| 157 | + compat_vintage: 5.10.5 |
| 158 | + - name: spring-boot-4.0-jdk17 |
| 159 | + java: 17 |
| 160 | + spring_boot: 4.0.0 |
| 161 | + java_version_prop: 17 |
| 162 | + compat_slf4j: 2.0.17 |
| 163 | + compat_vintage: 6.0.1 |
| 164 | + name: compat-spring-boot-${{ matrix.name }} |
| 165 | + steps: |
| 166 | + - uses: actions/checkout@v4 |
| 167 | + - name: Set up JDK |
| 168 | + uses: actions/setup-java@v4 |
| 169 | + with: |
| 170 | + distribution: temurin |
| 171 | + java-version: ${{ matrix.java }} |
| 172 | + - name: Cache Maven packages |
| 173 | + uses: actions/cache@v4 |
| 174 | + with: |
| 175 | + path: ~/.m2/repository |
| 176 | + key: ${{ runner.os }}-maven-compat-spring-boot-${{ matrix.name }}-${{ hashFiles('**/pom.xml') }} |
| 177 | + restore-keys: | |
| 178 | + ${{ runner.os }}-maven-compat-spring-boot-${{ matrix.name }}- |
| 179 | + ${{ runner.os }}-maven- |
| 180 | + - name: Build local artifacts for spring boot compatibility |
| 181 | + run: | |
| 182 | + mvn -B -pl apollo-core,apollo-client,apollo-mockserver,apollo-client-config-data -am \ |
| 183 | + -DskipTests \ |
| 184 | + install -Dmaven.gitcommitid.skip=true |
| 185 | + - name: Run spring boot compatibility tests |
| 186 | + run: | |
| 187 | + mvn -B -f apollo-compat-tests/pom.xml -pl apollo-spring-boot-compat-it \ |
| 188 | + -Dspring-boot.version=${{ matrix.spring_boot }} \ |
| 189 | + -Djava.version=${{ matrix.java_version_prop }} \ |
| 190 | + -Dcompat.slf4j.version=${{ matrix.compat_slf4j }} \ |
| 191 | + -Dcompat.junit.vintage.version=${{ matrix.compat_vintage }} \ |
| 192 | + test -Dmaven.gitcommitid.skip=true |
0 commit comments