Skip to content

Commit

Permalink
Revert "ci: Fix CI failures after branch adjustment (#2280)"
Browse files Browse the repository at this point in the history
This reverts commit a633946.
  • Loading branch information
justxuewei authored Apr 6, 2023
1 parent 6361d9f commit b0a4fff
Show file tree
Hide file tree
Showing 38 changed files with 621 additions and 642 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ name: "CodeQL"

on:
push:
branches: "*"
branches: [master, ]
pull_request:
# The branches below must be a subset of the branches above
branches: "*"
branches: [master]
schedule:
- cron: '0 4 * * 5'

permissions:
contents: read
Expand Down
48 changes: 25 additions & 23 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: "*"
branches: [master, develop, "1.5", "3.0"]
pull_request:
branches: "*"

Expand All @@ -21,15 +21,19 @@ jobs:
os:
- ubuntu-latest

env:
DING_TOKEN: ${{ secrets.DING_TOKEN }}
DING_SIGN: ${{ secrets.DING_SIGN }}

steps:

- name: Setup Go ${{ matrix.go_version }}
- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go_version }}
id: go

- name: Checkout
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Cache dependencies
Expand All @@ -43,19 +47,18 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Merge code into the upstream
- name: Merge base
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "$GITHUB_BASE_REF, $GITHUB_REF_NAME, $GITHUB_REF"
git fetch origin $GITHUB_BASE_REF
git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF
git fetch origin 3.1
git checkout -b 3.1 origin/3.1
git remote add devrepo https://github.com/${{github.event.pull_request.head.repo.full_name}}.git
git fetch devrepo ${{github.event.pull_request.head.sha}}
git config --global user.email "dubbo-go@github-ci.com"
git config --global user.name "robot"
git merge ${{github.event.pull_request.head.sha}}
- name: Install dependencies
- name: Get dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
Expand All @@ -64,30 +67,29 @@ jobs:
go get -v -t -d ./...
fi
- name: Format code
- name: gofmt
run: |
go fmt ./... && git status && [[ -z `git status -s` ]]
# diff -u <(echo -n) <(gofmt -d -s .)
- name: Verify
run: |
make verify
# This step only runs when the event type is a pull_request
- name: Integration Testing
- name: Integrate Test
if: ${{ github.event_name == 'pull_request' }}
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
chmod +x integrate_test.sh \
&& [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] \
&& [[ -n "${{github.event.pull_request.head.sha}}" ]] \
&& [[ -n "${{github.base_ref}}" ]] \
&& ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}}
elif [ "$GITHUB_EVENT_NAME" == "push" ]; then
chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
else
echo "$GITHUB_EVENT_NAME is an unsupported event type."
exit 1
fi
chmod +x integrate_test.sh && [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] && [[ -n "${{github.event.pull_request.head.sha}}" ]] && [[ -n "${{github.base_ref}}" ]] && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}}
- name: Codecov
# This step only runs when the event type is a push
- name: Integrate Test
if: ${{ github.event_name == 'push' }}
run: |
chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
- name: Post Coverage
run: bash <(curl -s https://codecov.io/bash)

- name: Hello world
run: echo Hello world ${{ secrets.DING_TOKEN }} ${{ secrets.DING_SIGN }}
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: golangci-lint
on:
push:
branches: "*"
branches: [master, develop, "1.5", "3.0"]
pull_request:
branches: "*"

Expand Down
2 changes: 1 addition & 1 deletion common/constant/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const (
MaxServerRecvMsgSize = "max-server-recv-msg-size"
)

// tls constant
//tls constant
const (
TLSKey = "tls_key"
TLSCert = "tls_cert"
Expand Down
2 changes: 1 addition & 1 deletion common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ func (c *URL) GetNonDefaultParam(s string) (string, bool) {
r = c.params.Get(s)
}

return r, r != ""
return r, r != ""
}

// GetParams gets values
Expand Down
5 changes: 2 additions & 3 deletions config/config_center_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ func (c *CenterConfig) GetUrlMap() url.Values {
return urlMap
}

// translateConfigAddress translate config address
//
// eg:address=nacos://127.0.0.1:8848 will return 127.0.0.1:8848 and protocol will set nacos
//translateConfigAddress translate config address
// eg:address=nacos://127.0.0.1:8848 will return 127.0.0.1:8848 and protocol will set nacos
func (c *CenterConfig) translateConfigAddress() string {
if strings.Contains(c.Address, "://") {
translatedUrl, err := url.Parse(c.Address)
Expand Down
3 changes: 2 additions & 1 deletion config/config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ func registerServiceInstance() {
}
}

// // nolint
//
//// nolint
func createInstance(url *common.URL) (registry.ServiceInstance, error) {
appConfig := GetApplicationConfig()
port, err := strconv.ParseInt(url.Port, 10, 32)
Expand Down
2 changes: 1 addition & 1 deletion config/graceful_shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func waitingProviderProcessedTimeout(shutdownConfig *ShutdownConfig) {
}
}

// for provider. It will wait for processing receiving requests
//for provider. It will wait for processing receiving requests
func waitForSendingAndReceivingRequests() {
logger.Info("Graceful shutdown --- Keep waiting until sending/accepting requests finish or timeout. ")
if rootConfig == nil || rootConfig.Shutdown == nil {
Expand Down
1 change: 1 addition & 0 deletions config/metadata_report_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func publishServiceDefinition(url *common.URL) {
}
}

//
// selectMetadataServiceExportedURL get already be exported url
func selectMetadataServiceExportedURL() *common.URL {
var selectedUrl *common.URL
Expand Down
Loading

0 comments on commit b0a4fff

Please sign in to comment.