-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from duanmengkk/add_github_ci
add github ci for netdoctor
- Loading branch information
Showing
8 changed files
with
291 additions
and
0 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,22 @@ | ||
--- | ||
name: Bug Report | ||
about: Report a bug encountered while using Kosmos. | ||
labels: kind/bug | ||
|
||
--- | ||
|
||
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! | ||
--> | ||
|
||
|
||
**What happened**: | ||
|
||
**What you expected to happen**: | ||
|
||
**How to reproduce it (as minimally and precisely as possible)**: | ||
|
||
**Anything else we need to know?**: | ||
|
||
**Environment**: | ||
- Netdoctor version: | ||
- Others: |
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,11 @@ | ||
--- | ||
name: Enhancement Request | ||
about: Suggest an enhancement to the project | ||
labels: kind/feature | ||
|
||
--- | ||
<!-- Please only use this template for submitting enhancement requests --> | ||
|
||
**What would you like to be added**: | ||
|
||
**Why is this needed**: |
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,15 @@ | ||
--- | ||
name: Flaking Test | ||
about: Report flaky tests or jobs in CI | ||
labels: kind/flake | ||
|
||
--- | ||
|
||
#### Which jobs are flaking: | ||
|
||
#### Which test(s) are flaking: | ||
|
||
#### Reason for failure: | ||
|
||
#### Anything else we need to know: | ||
|
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,31 @@ | ||
--- | ||
name: Good First Issue | ||
about: Publish a good first issue | ||
labels: good first issue | ||
|
||
--- | ||
|
||
<!-- Please use this template while publishing a good first issue. Thanks! | ||
--> | ||
|
||
**Task description**: | ||
|
||
**Solution**: | ||
|
||
**Who can join or take the task**: | ||
|
||
The good first issue is intended for `first-time contributors` to get started on his/her contributor journey. | ||
|
||
After a contributor has successfully completed 1-2 good first issue's, | ||
they should be ready to move on to `help wanted` items, saving the remaining `good first issue` for other new contributors. | ||
|
||
**How to join or take the task**: | ||
|
||
Just reply on the issue with the message `/assign` in a separate line. | ||
|
||
Then, the issue will be assigned to you. | ||
|
||
**How to ask for help**: | ||
|
||
If you need help or have questions, please feel free to ask on this issue. | ||
The issue author or other members of the community will guide you through the contribution process. |
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,19 @@ | ||
--- | ||
name: Question | ||
about: Question relating to Kosmos. | ||
labels: kind/question | ||
|
||
--- | ||
|
||
<!-- Please use this template while asking a new question. Thanks! | ||
Please make sure you have read the FAQ and searched the issue list. | ||
- Issues: https://github.com/kosmos-io/kosmos/issues | ||
--> | ||
**Please provide an in-depth description of the question you have**: | ||
|
||
**What do you think about this question?**: | ||
|
||
**Environment**: | ||
- Kosmos version: | ||
- Kubernetes version: | ||
- Others: |
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,42 @@ | ||
<!-- Thanks for sending a pull request! Here are some tips for you: | ||
1. If this is your first time, Please carefully read the comments in our pull request template. | ||
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. | ||
3. Ensure you have added or ran the appropriate tests for your PR. | ||
4. If you want *faster* PR reviews, Please contact us proactively. | ||
--> | ||
|
||
#### What type of PR is this? | ||
|
||
<!-- | ||
Add one of the following kinds: | ||
/kind bug | ||
/kind cleanup | ||
/kind docs | ||
/kind feature | ||
/kind failing-test | ||
--> | ||
|
||
#### What does this PR do? | ||
<!-- | ||
Provide a brief description of what this PR does | ||
--> | ||
|
||
#### Which issue(s) does this PR fix? | ||
<!-- | ||
Reference any relevant issue(s) by using the syntax `Fixes #<issue_number>`, If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_* | ||
--> | ||
Fixes # | ||
#### Special notes for your reviewer: | ||
<!-- | ||
If there's anything specific you'd like your reviewer to pay attention to, mention it here | ||
--> | ||
|
||
#### Does this PR introduce a user-facing change? | ||
<!-- | ||
If no, just write "NONE" in the release-note block below. | ||
If yes, a release note is required. | ||
--> | ||
```release-note | ||
``` |
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,104 @@ | ||
name: CI | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
- name: golint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54.1 | ||
verify: | ||
name: verify | ||
runs-on: ubuntu-22.04 | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
WORKSPACE: ${{ github.workspace }}/src/github.com/kosmos-io/netdoctor | ||
defaults: | ||
run: | ||
working-directory: ${{ env.WORKSPACE }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ env.WORKSPACE }} | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
- run: hack/verify-vendor.sh | ||
- run: hack/verify-codegen.sh | ||
- run: hack/verify-crds.sh | ||
build: | ||
name: build | ||
needs: verify | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
- name: Compile | ||
run: make all | ||
test: | ||
name: Unit test | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
- run: make test | ||
e2e: | ||
name: E2e test | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
# Free up disk space on Ubuntu | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
# this might remove tools that are actually needed, if set to "true" but frees about 6 GB | ||
tool-cache: false | ||
# all of these default to true, but feel free to set to "false" if necessary for your workflow | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
- name: Prepare e2e env | ||
run: ./hack/prepare-e2e.sh | ||
- name: Run e2e test | ||
run: ./hack/rune2e.sh | ||
- name: Upload logs | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: kosmos-e2e-logs-${{ github.run_id }} | ||
path: ${{ github.workspace }}/e2e-test/logs-* |
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,47 @@ | ||
## Workflow's name | ||
#name: release kosmosctl for linux&darwin | ||
# | ||
## Workflow's trigger | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
# Workflow's jobs | ||
jobs: | ||
# job's id | ||
release: | ||
# job's name | ||
name: release netctl for linux&darwin | ||
|
||
# allow to upload release binary | ||
permissions: write-all | ||
|
||
# the type of machine to run the job on | ||
runs-on: ubuntu-20.04 | ||
|
||
# create steps | ||
steps: | ||
# step1: check out repository | ||
- name: Check out git repository | ||
uses: actions/checkout@v3 | ||
|
||
# step2: install go env | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
|
||
# step3: make binaries | ||
- name: Make binaries | ||
run: make netctl | ||
|
||
# step4: create release | ||
- name: release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
_output/release/netctl-linux-amd64 | ||
_output/release/netctl-linux-arm64 | ||
_output/release/netctl-darwin-amd64 | ||
_output/release/netctl-darwin-arm64 | ||