This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
add workflow ci for yurt-app-manager #72
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,117 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release-* | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
|
||
env: | ||
# Common versions | ||
GO_VERSION: '1.16' | ||
GOLANGCI_VERSION: 'v1.42.1' | ||
DOCKER_BUILDX_VERSION: 'v0.4.2' | ||
|
||
jobs: | ||
|
||
check-license: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Run Check License | ||
run: hack/make-rules/check_license.sh | ||
|
||
golangci-lint: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Lint golang code | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: ${{ env.GOLANGCI_VERSION }} | ||
args: -v | ||
|
||
markdownlint-misspell-shellcheck: | ||
runs-on: ubuntu-18.04 | ||
# this image is build from Dockerfile | ||
# https://github.com/pouchcontainer/pouchlinter/blob/master/Dockerfile | ||
container: pouchcontainer/pouchlinter:v0.1.2 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Run misspell | ||
run: find ./* -name "*" | xargs misspell -error | ||
- name: Lint markdown files | ||
run: find ./ -name "*.md" | grep -v enhancements | grep -v .github | xargs mdl -r ~MD010,~MD013,~MD014,~MD022,~MD024,~MD029,~MD031,~MD032,~MD033,~MD034,~MD036 | ||
# - name: Check markdown links | ||
# run: | | ||
# set +e | ||
# for name in $(find . -name \*.md | grep -v CHANGELOG); do | ||
# if [ -f $name ]; then | ||
# markdown-link-check -q $name -c .github/workflows/markdown-link-check.config.json; | ||
# if [ $? -ne 0 ]; then | ||
# code=1 | ||
# fi | ||
# fi | ||
# done | ||
# bash -c "exit $code"; | ||
|
||
unit-tests: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Fetch History | ||
run: git fetch --prune --unshallow | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Cache Go Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go- | ||
- name: Run Unit Tests | ||
run: make test | ||
- name: Publish Unit Test Coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
name: codecov-umbrella | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: unittests | ||
files: ./cover.out | ||
fail_ci_if_error: true | ||
verbose: true | ||
build-binaries: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Fetch History | ||
run: git fetch --prune --unshallow | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Cache Go Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go- | ||
- name: Build All Binaries | ||
run: make build |
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 |
---|---|---|
|
@@ -6,5 +6,6 @@ dockerbuild | |
|
||
*.out | ||
logs | ||
bin | ||
bin/controller-gen | ||
bin/kustomize |
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,48 @@ | ||
# This file contains all available configuration options | ||
# with their default values. | ||
|
||
# options for analysis running | ||
run: | ||
go: '1.16' | ||
# default concurrency is a available CPU number | ||
concurrency: 4 | ||
|
||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 15m | ||
|
||
# exit code when at least one issue was found, default is 1 | ||
issues-exit-code: 1 | ||
|
||
# include test files or not, default is true | ||
tests: true | ||
|
||
# output configuration options | ||
output: | ||
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions | ||
# default is "colored-line-number" | ||
format: colored-line-number | ||
|
||
# print lines of code with issue, default is true | ||
print-issued-lines: true | ||
|
||
# print linter name in the end of issue text, default is true | ||
print-linter-name: true | ||
|
||
# make issues output unique by line, default is true | ||
uniq-by-line: true | ||
|
||
# all available settings of specific linters | ||
linters-settings: | ||
gci: | ||
local-prefixes: github.com/openyurtio | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- gofmt | ||
- goimports | ||
- gci | ||
- ineffassign | ||
- misspell | ||
- vet |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we will install golangci-lint@1.42.1.
But we run golangci-lint@1.31.1 in github actions.
We should make them the same version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.