-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add stream ci for lint (merge request !1614)
Squash merge branch 'feat/stream' into 'master' feat: add stream ci for lint
- Loading branch information
Showing
125 changed files
with
4,180 additions
and
1,692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: v2.0 | ||
|
||
on: | ||
push: [ master ] | ||
mr: [ master, v1.* ] | ||
|
||
stages: | ||
- name: lint | ||
jobs: | ||
prepare: | ||
steps: | ||
- checkout: self | ||
name: 拉取代码 | ||
- run: | | ||
dir_json="$(find . -type f -name '.golangci.yml' -exec dirname {} \; | sed 's|^\./||' | sort -u | jq -c -R -s 'split("\n") | map(select(. != "")) | {dirs: .}')" | ||
echo "::set-output name=parameters::$dir_json" | ||
id: set-matrix | ||
name: 矩阵参数生成 | ||
- run: | | ||
bcs_image=${{ settings.bcs_docker_image.password }} | ||
echo "::set-output name=parameters::$bcs_image" | ||
id: set-image | ||
name: 镜像参数设置 | ||
build: | ||
depend-on: | ||
- prepare | ||
strategy: | ||
matrix: ${{ fromJSON(jobs.prepare.steps.set-matrix.outputs.parameters) }} | ||
max-parallel: 20 | ||
name: ${{ matrix.dirs }} 代码检查 | ||
runs-on: | ||
pool-name: docker | ||
container: | ||
image: ${{ jobs.prepare.steps.set-image.outputs.parameters }} | ||
steps: | ||
- checkout: self | ||
name: 拉取代码 | ||
- run: | | ||
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2 | ||
mv ./bin/golangci-lint /usr/bin/golangci-lint | ||
cd ${{ matrix.dirs }} | ||
go mod tidy | ||
CGO_ENABLED=0 golangci-lint run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.