Skip to content

Commit

Permalink
Add Dubbo-Spring-Boot build for github actions (#7135)
Browse files Browse the repository at this point in the history
* Add Dubbo-Spring-Boot build for github actions

* Add dubbo-spring-boot git branch env

* Add workflow_dispatch support
  • Loading branch information
AlbumenJ authored Jan 27, 2021
1 parent 8a6fd8b commit 02f236e
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Test

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

env:
FORK_COUNT: 2
Expand All @@ -13,6 +13,8 @@ env:
spring-boot.version:1.5.22.RELEASE;
spring-boot.version:2.4.1;
'
DUBBO_SPRING_BOOT_REF: '2.7.x'

jobs:
build-source:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -44,6 +46,47 @@ jobs:
name: dubbo-version
path: dubbo-version

build-dubbo-spring-boot:
runs-on: ubuntu-latest
outputs:
commit_id: ${{ steps.git-checker.outputs.commit_id }}
cache-hit: ${{ steps.dubbocache.outputs.cache-hit }}
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-spring-boot-project'
ref: ${{env.DUBBO_SPRING_BOOT_REF}}
- name: "Get commit id"
id: git-checker
run: |
#compare dubbo commit id
last_commit_id=`git log --format="%H" -n 1`
echo "::set-output name=commit_id::$last_commit_id"
echo "commit_id: $last_commit_id"
- name: "Dubbo-spring-boot cache"
id: dubbocache
uses: actions/cache@v2
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-spring-boot-snapshot-${{steps.git-checker.outputs.commit_id}}
- name: "Cache local Maven repository"
if: steps.dubbocache.outputs.cache-hit != 'true'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-dubbo-spring-boot-${{env.DUBBO_SPRING_BOOT_REF}}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-dubbo-spring-boot-${{env.DUBBO_SPRING_BOOT_REF}}-maven-
- name: "Set up JDK 8"
if: steps.dubbocache.outputs.cache-hit != 'true'
uses: actions/setup-java@v1
with:
java-version: 8
- name: "Build dubbo spring boot"
if: steps.dubbocache.outputs.cache-hit != 'true'
run: |
./mvnw --batch-mode --no-transfer-progress clean install -Dmaven.test.skip=true -Dmaven.test.skip.exec=true
unit-test:
needs: [build-source]
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
Expand Down Expand Up @@ -128,6 +171,11 @@ jobs:
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
restore-keys: |
${{ runner.os }}-dubbo-
- name: "Restore Dubbo-spring-boot cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-spring-boot-snapshot-${{needs.build-dubbo-spring-boot.outputs.commit_id}}
- name: "Download test list"
uses: actions/download-artifact@v2
with:
Expand Down

0 comments on commit 02f236e

Please sign in to comment.