upgrade github action checkout@v2 (#10889)

enhance go_check order to make it fail earlier

Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
Ziming 2020-02-29 01:15:27 +08:00 committed by GitHub
parent 8de3fab3c5
commit 5f2544941e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 21 deletions

View File

@ -37,20 +37,22 @@ jobs:
with:
docker_version: 18.09
docker_channel: stable
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor
- name: setup env
run: |
cd src/github.com/goharbor/harbor
pwd
go env
echo "::set-env name=GOPATH::$(go env GOPATH):$RUNNER_WORKSPACE"
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
echo "::add-path::$(go env GOPATH)/bin"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/tests/private_key.pem"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor
pwd
env
#sudo apt install -y xvfb
@ -66,6 +68,7 @@ jobs:
sudo service docker restart
- name: install
run: |
cd src/github.com/goharbor/harbor
env
bash ./tests/showtime.sh ./tests/travis/ut_install.sh
- name: script
@ -73,12 +76,13 @@ jobs:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo IP: $IP
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/travis/ut_run.sh $IP
- name: Codecov For BackEnd
uses: codecov/codecov-action@v1
with:
file: ./profile.cov
yml: ./.github/codecov-ut-config/codecov.yml
file: ./src/github.com/goharbor/harbor/profile.cov
yml: ./src/github.com/goharbor/harbor/.github/codecov-ut-config/codecov.yml
APITEST_DB:
env:
@ -97,20 +101,22 @@ jobs:
with:
docker_version: 18.09
docker_channel: stable
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor
- name: setup env
run: |
cd src/github.com/goharbor/harbor
pwd
go env
echo "::set-env name=GOPATH::$(go env GOPATH):$RUNNER_WORKSPACE"
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
echo "::add-path::$(go env GOPATH)/bin"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/tests/private_key.pem"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor
pwd
env
#sudo apt install -y xvfb
@ -126,10 +132,12 @@ jobs:
sudo service docker restart
- name: install
run: |
cd src/github.com/goharbor/harbor
env
bash ./tests/showtime.sh ./tests/travis/api_common_install.sh $IP DB
- name: script
run: |
cd src/github.com/goharbor/harbor
echo IP: $IP
bash ./tests/showtime.sh ./tests/travis/api_run.sh DB $IP
@ -150,20 +158,22 @@ jobs:
with:
docker_version: 18.09
docker_channel: stable
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor
- name: setup env
run: |
cd src/github.com/goharbor/harbor
pwd
go env
echo "::set-env name=GOPATH::$(go env GOPATH):$RUNNER_WORKSPACE"
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
echo "::add-path::$(go env GOPATH)/bin"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/tests/private_key.pem"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor
pwd
env
#sudo apt install -y xvfb
@ -179,11 +189,13 @@ jobs:
sudo service docker restart
- name: install
run: |
cd src/github.com/goharbor/harbor
env
bash ./tests/showtime.sh ./tests/travis/api_common_install.sh $IP LDAP
- name: script
run: |
echo IP: $IP
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/travis/api_run.sh LDAP $IP
OFFLINE:
@ -203,21 +215,23 @@ jobs:
with:
docker_version: 18.09
docker_channel: stable
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor
- name: setup env
run: |
cd src/github.com/goharbor/harbor
pwd
docker version
go env
echo "::set-env name=GOPATH::$(go env GOPATH):$RUNNER_WORKSPACE"
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
echo "::add-path::$(go env GOPATH)/bin"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/tests/private_key.pem"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor
pwd
env
#sudo apt install -y xvfb
@ -234,6 +248,7 @@ jobs:
- name: script
run: |
echo IP: $IP
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/travis/distro_installer.sh
UI_UT:
@ -246,20 +261,22 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '10.16.2'
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor
- name: setup env
run: |
cd src/github.com/goharbor/harbor
pwd
go env
echo "::set-env name=GOPATH::$(go env GOPATH):$RUNNER_WORKSPACE"
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
echo "::add-path::$(go env GOPATH)/bin"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/tests/private_key.pem"
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor
pwd
env
#sudo apt install -y xvfb
@ -276,9 +293,10 @@ jobs:
- name: script
run: |
echo IP: $IP
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/travis/ui_ut_run.sh
- name: Codecov For UI
uses: codecov/codecov-action@v1.0.5
with:
file: ./src/portal/coverage/lcov.info
yml: ./.github/codecov-ut-config/codecov.yml
file: ./src/github.com/goharbor/harbor/src/portal/coverage/lcov.info
yml: ./src/github.com/goharbor/harbor/.github/codecov-ut-config/codecov.yml

View File

@ -419,7 +419,7 @@ gosec:
$(GOPATH)/bin/gosec -fmt=json -out=harbor_gas_output.json -quiet ./... | true ; \
fi
go_check: gen_apis misspell golint govet gofmt commentfmt
go_check: gen_apis misspell gofmt commentfmt golint govet
gofmt:
@echo checking gofmt...
@ -432,7 +432,7 @@ gofmt:
commentfmt:
@echo checking comment format...
@res=$$(find . -type d \( -path ./src/vendor -o -path ./tests \) -prune -o -name '*.go' -print | xargs grep -P '(^|\s)\/\/(?!go:generate\s)(\S)'); \
@res=$$(find . -type d \( -path ./src/vendor -o -path ./tests \) -prune -o -name '*.go' -print | xargs egrep '(^|\s)\/\/(\S)'|grep -v '//go:generate'); \
if [ -n "$${res}" ]; then \
echo checking comment format fail.. ; \
echo missing whitespace between // and comment body;\