| name: CI |
| |
| on: |
| push: |
| branches: [ master ] |
| pull_request: |
| branches: "*" |
| |
| jobs: |
| build: |
| |
| runs-on: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Set up JDK 1.8 |
| uses: actions/setup-java@v1 |
| with: |
| java-version: 1.8 |
| |
| - name: Set up Go 1.x |
| uses: actions/setup-go@v2 |
| with: |
| go-version: 1.12 |
| id: go |
| |
| - name: Cache Go Dependence |
| uses: actions/cache@v2 |
| with: |
| path: ~/go/pkg/mod |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| restore-keys: | |
| ${{ runner.os }}-go- |
| |
| - name: Cache local Maven repository |
| uses: actions/cache@v2 |
| with: |
| path: ~/.m2/repository |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-maven- |
| |
| - name: Java Test And Package |
| run: | |
| mvn clean package -DskipTests=true -f test_hessian/pom.xml |
| mvn test -f test_hessian/pom.xml |
| mvn clean package -f test_dubbo/pom.xml |
| |
| - name: Validate License |
| run: | |
| sh before_validate_license.sh |
| chmod u+x /tmp/tools/license/license-header-checker |
| /tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]] |
| |
| - name: Go Test |
| run: go mod vendor && go test -race -v && go test -bench . -race -coverprofile=coverage.txt |
| |
| - name: Coverage |
| run: bash <(curl -s https://codecov.io/bash) |
| |
| # - name: DingTalk Message Notify |
| # uses: zcong1993/actions-ding@v3.0.1 |
| # if: ${{ github.repository == 'apache/dubbo-go-hessian2' }} |
| # with: |
| # # DingDing bot token |
| # dingToken: #{your_token} |
| # secret: #{your_sign} |
| # # Post Body to send |
| # body: | |
| # { |
| # "msgtype": "markdown", |
| # "markdown": { |
| # "title": "Github Actions", |
| # "text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - trigger: ${{ github.actor }} \n - ref: ${{ github.ref }} \n - status: ${{ job.status }} \n - environment: ${{ runner.os }}" |
| # } |
| # } |