Skip to content

Commit 02f236e

Browse files
authored
Add Dubbo-Spring-Boot build for github actions (#7135)
* Add Dubbo-Spring-Boot build for github actions * Add dubbo-spring-boot git branch env * Add workflow_dispatch support
1 parent 8a6fd8b commit 02f236e

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

.github/workflows/build-and-test.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build and Test
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORK_COUNT: 2
@@ -13,6 +13,8 @@ env:
1313
spring-boot.version:1.5.22.RELEASE;
1414
spring-boot.version:2.4.1;
1515
'
16+
DUBBO_SPRING_BOOT_REF: '2.7.x'
17+
1618
jobs:
1719
build-source:
1820
runs-on: ubuntu-18.04
@@ -44,6 +46,47 @@ jobs:
4446
name: dubbo-version
4547
path: dubbo-version
4648

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+
4790
unit-test:
4891
needs: [build-source]
4992
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
@@ -128,6 +171,11 @@ jobs:
128171
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
129172
restore-keys: |
130173
${{ 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}}
131179
- name: "Download test list"
132180
uses: actions/download-artifact@v2
133181
with:

0 commit comments

Comments
 (0)