Skip to content

Commit 5f75c2f

Browse files
committed
improve dubbo cache and job depends
1 parent 02f236e commit 5f75c2f

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ jobs:
3434
path: ~/.m2/repository/org/apache/dubbo
3535
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
3636
- name: "Build with Maven"
37-
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true
37+
run: |
38+
./mvnw --batch-mode -U -e --no-transfer-progress clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true
39+
# just keep dubbo modules, remove dubbo-spring-boot-* modules from maven local repo
40+
cd ~/.m2/repository/org/apache/dubbo
41+
ls | grep dubbo-spring-boot | xargs -I {} rm -rf {}
42+
echo "removed dubbo-spring-boot* modules in local repo"
3843
- name: "Calculate Dubbo Version"
3944
run: |
4045
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' pom.xml`
@@ -47,6 +52,7 @@ jobs:
4752
path: dubbo-version
4853

4954
build-dubbo-spring-boot:
55+
needs: build-source
5056
runs-on: ubuntu-latest
5157
outputs:
5258
commit_id: ${{ steps.git-checker.outputs.commit_id }}
@@ -86,6 +92,10 @@ jobs:
8692
if: steps.dubbocache.outputs.cache-hit != 'true'
8793
run: |
8894
./mvnw --batch-mode --no-transfer-progress clean install -Dmaven.test.skip=true -Dmaven.test.skip.exec=true
95+
# just keep dubbo-spring-boot-* modules, remove other dubbo modules from maven local repo
96+
cd ~/.m2/repository/org/apache/dubbo
97+
ls | grep -v dubbo-spring-boot | xargs -I {} rm -rf {}
98+
echo "modules in `pwd`:" && ls
8999
90100
unit-test:
91101
needs: [build-source]
@@ -141,7 +151,7 @@ jobs:
141151
path: test/jobs
142152

143153
integration-test-job:
144-
needs: [build-source, integration-test-prepare]
154+
needs: [build-source, build-dubbo-spring-boot, integration-test-prepare]
145155
name: "Integration Test on ubuntu-18.04 (JobId: ${{matrix.job_id}})"
146156
runs-on: ubuntu-18.04
147157
timeout-minutes: 30
@@ -164,18 +174,16 @@ jobs:
164174
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
165175
restore-keys: |
166176
${{ runner.os }}-maven-
167-
- name: "Restore Dubbo cache"
177+
- name: "Restore Dubbo-spring-boot cache"
168178
uses: actions/cache@v2
169179
with:
170180
path: ~/.m2/repository/org/apache/dubbo
171-
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
172-
restore-keys: |
173-
${{ runner.os }}-dubbo-
174-
- name: "Restore Dubbo-spring-boot cache"
181+
key: ${{ runner.os }}-dubbo-spring-boot-snapshot-${{needs.build-dubbo-spring-boot.outputs.commit_id}}
182+
- name: "Restore Dubbo cache"
175183
uses: actions/cache@v2
176184
with:
177185
path: ~/.m2/repository/org/apache/dubbo
178-
key: ${{ runner.os }}-dubbo-spring-boot-snapshot-${{needs.build-dubbo-spring-boot.outputs.commit_id}}
186+
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
179187
- name: "Download test list"
180188
uses: actions/download-artifact@v2
181189
with:

0 commit comments

Comments
 (0)