dubbo.apache.org/dubbo-go/v3@v3.1.1/.github/workflows/github-actions.yml (about) 1 name: CI 2 3 on: 4 push: 5 branches: 6 - main 7 - 'release-*' 8 pull_request: 9 branches: "*" 10 11 permissions: 12 contents: read 13 14 jobs: 15 build: 16 name: ${{ matrix.os }} - Go ${{ matrix.go_version }} 17 runs-on: ${{ matrix.os }} 18 strategy: 19 # If you want to matrix build , you can append the following list. 20 matrix: 21 go_version: 22 - 1.17 23 os: 24 - ubuntu-latest 25 26 steps: 27 28 - name: Setup Go ${{ matrix.go_version }} 29 uses: actions/setup-go@v3 30 with: 31 go-version: ${{ matrix.go_version }} 32 id: go 33 34 - name: Checkout 35 uses: actions/checkout@v3 36 37 - name: Cache dependencies 38 uses: actions/cache@v3 39 with: 40 # Cache 41 path: ~/go/pkg/mod 42 # Cache key 43 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 44 # An ordered list of keys to use for restoring the cache if no cache hit occurred for key 45 restore-keys: | 46 ${{ runner.os }}-go- 47 48 - name: Merge code into the upstream 49 if: ${{ github.event_name == 'pull_request' }} 50 run: | 51 git fetch origin $GITHUB_BASE_REF 52 git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF 53 git remote add devrepo https://github.com/${{github.event.pull_request.head.repo.full_name}}.git 54 git fetch devrepo ${{github.event.pull_request.head.sha}} 55 git config --global user.email "dubbo-go@github-ci.com" 56 git config --global user.name "robot" 57 git merge ${{github.event.pull_request.head.sha}} 58 59 - name: Install dependencies 60 run: | 61 if [ -f Gopkg.toml ]; then 62 curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh 63 dep ensure 64 else 65 go get -v -t -d ./... 66 fi 67 68 - name: Format code 69 run: | 70 go fmt ./... && git status && [[ -z `git status -s` ]] 71 72 - name: Verify 73 run: | 74 make verify 75 76 - name: Integration Testing 77 run: | 78 if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then 79 chmod +x integrate_test.sh \ 80 && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}} 81 elif [ "$GITHUB_EVENT_NAME" == "push" ]; then 82 chmod +x integrate_test.sh \ 83 && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_REF_NAME 84 else 85 echo "$GITHUB_EVENT_NAME is an unsupported event type." 86 exit 1 87 fi 88 89 - name: Codecov 90 run: bash <(curl -s https://codecov.io/bash)