|
1 | 1 | name: Build and Test |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: [push, pull_request, workflow_dispatch] |
4 | 4 |
|
5 | 5 | env: |
6 | 6 | FORK_COUNT: 2 |
|
13 | 13 | spring-boot.version:1.5.22.RELEASE; |
14 | 14 | spring-boot.version:2.4.1; |
15 | 15 | ' |
| 16 | + DUBBO_SPRING_BOOT_REF: '2.7.x' |
| 17 | + |
16 | 18 | jobs: |
17 | 19 | build-source: |
18 | 20 | runs-on: ubuntu-18.04 |
|
44 | 46 | name: dubbo-version |
45 | 47 | path: dubbo-version |
46 | 48 |
|
| 49 | + build-dubbo-spring-boot: |
| 50 | + runs-on: ubuntu-latest |
| 51 | + outputs: |
| 52 | + commit_id: ${{ steps.git-checker.outputs.commit_id }} |
| 53 | + cache-hit: ${{ steps.dubbocache.outputs.cache-hit }} |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v2 |
| 56 | + with: |
| 57 | + repository: 'apache/dubbo-spring-boot-project' |
| 58 | + ref: ${{env.DUBBO_SPRING_BOOT_REF}} |
| 59 | + - name: "Get commit id" |
| 60 | + id: git-checker |
| 61 | + run: | |
| 62 | + #compare dubbo commit id |
| 63 | + last_commit_id=`git log --format="%H" -n 1` |
| 64 | + echo "::set-output name=commit_id::$last_commit_id" |
| 65 | + echo "commit_id: $last_commit_id" |
| 66 | + - name: "Dubbo-spring-boot cache" |
| 67 | + id: dubbocache |
| 68 | + uses: actions/cache@v2 |
| 69 | + with: |
| 70 | + path: ~/.m2/repository/org/apache/dubbo |
| 71 | + key: ${{ runner.os }}-dubbo-spring-boot-snapshot-${{steps.git-checker.outputs.commit_id}} |
| 72 | + - name: "Cache local Maven repository" |
| 73 | + if: steps.dubbocache.outputs.cache-hit != 'true' |
| 74 | + uses: actions/cache@v2 |
| 75 | + with: |
| 76 | + path: ~/.m2/repository |
| 77 | + key: ${{ runner.os }}-dubbo-spring-boot-${{env.DUBBO_SPRING_BOOT_REF}}-maven-${{ hashFiles('**/pom.xml') }} |
| 78 | + restore-keys: | |
| 79 | + ${{ runner.os }}-dubbo-spring-boot-${{env.DUBBO_SPRING_BOOT_REF}}-maven- |
| 80 | + - name: "Set up JDK 8" |
| 81 | + if: steps.dubbocache.outputs.cache-hit != 'true' |
| 82 | + uses: actions/setup-java@v1 |
| 83 | + with: |
| 84 | + java-version: 8 |
| 85 | + - name: "Build dubbo spring boot" |
| 86 | + if: steps.dubbocache.outputs.cache-hit != 'true' |
| 87 | + run: | |
| 88 | + ./mvnw --batch-mode --no-transfer-progress clean install -Dmaven.test.skip=true -Dmaven.test.skip.exec=true |
| 89 | +
|
47 | 90 | unit-test: |
48 | 91 | needs: [build-source] |
49 | 92 | name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})" |
@@ -128,6 +171,11 @@ jobs: |
128 | 171 | key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }} |
129 | 172 | restore-keys: | |
130 | 173 | ${{ runner.os }}-dubbo- |
| 174 | + - name: "Restore Dubbo-spring-boot cache" |
| 175 | + uses: actions/cache@v2 |
| 176 | + with: |
| 177 | + path: ~/.m2/repository/org/apache/dubbo |
| 178 | + key: ${{ runner.os }}-dubbo-spring-boot-snapshot-${{needs.build-dubbo-spring-boot.outputs.commit_id}} |
131 | 179 | - name: "Download test list" |
132 | 180 | uses: actions/download-artifact@v2 |
133 | 181 | with: |
|
0 commit comments