Skip to content

Commit

Permalink
fix(ci): Fix ci failures after branch adjustment
Browse files Browse the repository at this point in the history
Signed-off-by: Xuewei Niu <justxuewei@apache.org>
  • Loading branch information
justxuewei committed Mar 29, 2023
1 parent 3c831fb commit 10e0167
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 30 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: "CodeQL"

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

permissions:
contents: read
Expand Down
48 changes: 23 additions & 25 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: [master, develop, "1.5", "3.0"]
branches: "*"
pull_request:
branches: "*"

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

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

steps:

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

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

- name: Cache dependencies
Expand All @@ -47,18 +43,19 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Merge base
- name: Merge code into the upstream
if: ${{ github.event_name == 'pull_request' }}
run: |
git fetch origin 3.1
git checkout -b 3.1 origin/3.1
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 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: Get dependencies
- name: Install dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
Expand All @@ -67,29 +64,30 @@ jobs:
go get -v -t -d ./...
fi
- name: gofmt
- name: Format code
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: Integrate Test
- name: Integration Testing
if: ${{ github.event_name == 'pull_request' }}
run: |
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}}
# 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
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
- name: Post Coverage
- name: Codecov
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: [master, develop, "1.5", "3.0"]
branches: "*"
pull_request:
branches: "*"

Expand Down

0 comments on commit 10e0167

Please sign in to comment.