Skip to content

Commit dae4cfe

Browse files
authored
Merge pull request #42 from andyzhangx/add-github-action
test: add github action test and doc template
2 parents ce26141 + 3aa9545 commit dae4cfe

File tree

10 files changed

+299
-0
lines changed

10 files changed

+299
-0
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve this project
4+
5+
---
6+
7+
<!-- 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!
8+
-->
9+
10+
11+
**What happened**:
12+
13+
**What you expected to happen**:
14+
15+
**How to reproduce it**:
16+
17+
**Anything else we need to know?**:
18+
19+
**Environment**:
20+
- Kubernetes version (use `kubectl version`):
21+
- OS (e.g. from /etc/os-release):
22+
- Kernel (e.g. `uname -a`):
23+
- Install tools:
24+
- Others:

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Enhancement Request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
8+
**Is your feature request related to a problem?/Why is this needed**
9+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
10+
11+
**Describe the solution you'd like in detail**
12+
<!-- A clear and concise description of what you want to happen. -->
13+
14+
**Describe alternatives you've considered**
15+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
16+
17+
**Additional context**
18+
<!-- Add any other context or screenshots about the feature request here. -->

.github/ISSUE_TEMPLATE/support.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Support Request
3+
about: Ask questions about this project
4+
5+
---
6+
7+
<!--
8+
STOP -- PLEASE READ!
9+
10+
GitHub is not the right place for support requests.
11+
12+
If you're looking for help, post your question on the [Kubernetes Slack ](http://slack.k8s.io/) sig-storage Channel.
13+
14+
If the matter is security related, please disclose it privately via https://kubernetes.io/security/.
15+
-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!-- Thanks for sending a pull request! Here are some tips for you:
2+
3+
1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
4+
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
5+
https://git.k8s.io/community/contributors/devel/release.md#issue-kind-label
6+
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/testing.md
7+
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
8+
5. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md
9+
6. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
10+
-->
11+
12+
**What type of PR is this?**
13+
14+
<!--
15+
Add one of the following kinds:
16+
/kind bug
17+
/kind cleanup
18+
/kind documentation
19+
/kind feature
20+
/kind design
21+
22+
Optionally add one or more of the following kinds if applicable:
23+
/kind api-change
24+
/kind deprecation
25+
/kind failing-test
26+
/kind flake
27+
/kind regression
28+
-->
29+
30+
**What this PR does / why we need it**:
31+
32+
**Which issue(s) this PR fixes**:
33+
<!--
34+
*Automatically closes linked issue when PR is merged.
35+
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
36+
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
37+
-->
38+
Fixes #
39+
40+
**Requirements**:
41+
- [ ] uses [conventional commit messages](https://www.conventionalcommits.org/)
42+
<!-- Common commit types:
43+
build: Build 🏭
44+
chore: Maintenance 🔧
45+
ci: Continuous Integration 💜
46+
docs: Documentation 📘
47+
feat: Features 🌈
48+
fix: Bug Fixes 🐞
49+
perf: Performance Improvements 🚀
50+
refactor: Code Refactoring 💎
51+
revert: Revert Change ◀️
52+
style: Code Style 🎶
53+
security: Security Fix 🛡️
54+
test: Testing 💚 -->
55+
- [ ] includes documentation
56+
- [ ] adds unit tests
57+
- [ ] tested upgrade from previous version
58+
59+
**Special notes for your reviewer**:
60+
61+
62+
**Release note**:
63+
```
64+
none
65+
```

.github/workflows/codeql-analysis.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master, 'release-**' ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master, 'release-**' ]
20+
schedule:
21+
- cron: '0 */24 * * *'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Set up Go 1.x
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: ^1.18
44+
id: go
45+
46+
- name: Checkout repository
47+
uses: actions/checkout@v3
48+
49+
# Initializes the CodeQL tools for scanning.
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@v1
52+
with:
53+
languages: ${{ matrix.language }}
54+
# If you wish to specify custom queries, you can do so here or in a config file.
55+
# By default, queries listed here will override any specified in a config file.
56+
# Prefix the list here with "+" to use these queries and those in the config file.
57+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
run: |
63+
make all
64+
65+
- name: Perform CodeQL Analysis
66+
uses: github/codeql-action/analyze@v1

.github/workflows/codespell.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# GitHub Action to automate the identification of common misspellings in text files.
2+
# https://github.com/codespell-project/actions-codespell
3+
# https://github.com/codespell-project/codespell
4+
name: codespell
5+
on: [push, pull_request]
6+
jobs:
7+
codespell:
8+
name: Check for spelling errors
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: codespell-project/actions-codespell@master
13+
with:
14+
check_filenames: true
15+
skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum
16+
ignore_words_list: "browseable,ro"

.github/workflows/darwin.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: MacOS Unit Tests
2+
on:
3+
pull_request: {}
4+
push: {}
5+
6+
jobs:
7+
8+
build:
9+
name: Build
10+
runs-on: macos-latest
11+
steps:
12+
13+
- name: Set up Go 1.x
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: ^1.19
17+
id: go
18+
19+
- name: Check out code into the Go module directory
20+
uses: actions/checkout@v2
21+
22+
- name: Run unit tests on MacOS
23+
run: go test -v -race ./iscsi/...

.github/workflows/linux.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Linux Unit tests
2+
on:
3+
pull_request: {}
4+
push: {}
5+
6+
jobs:
7+
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Set up Go 1.x
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: ^1.19
17+
id: go
18+
19+
- name: Check out code into the Go module directory
20+
uses: actions/checkout@v2
21+
22+
- name: Unit Test
23+
run: |
24+
go test -v -race ./iscsi/...

.github/workflows/shellcheck.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ShellCheck
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- release-*
9+
pull_request:
10+
branches:
11+
- master
12+
- release-*
13+
14+
jobs:
15+
shellcheck:
16+
name: Shellcheck
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Run ShellCheck
21+
uses: ludeeus/action-shellcheck@master
22+
env:
23+
SHELLCHECK_OPTS: -e SC2034
24+
with:
25+
severity: warning
26+
check_together: 'yes'
27+
disable_matcher: false
28+
ignore_paths: vendor release-tools hack
29+
format: gcc

.github/workflows/static.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Static Checks
2+
on:
3+
pull_request: {}
4+
push: {}
5+
jobs:
6+
go_lint:
7+
name: Go Lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Set up Go 1.x
11+
uses: actions/setup-go@v3
12+
with:
13+
go-version: ^1.19
14+
- uses: actions/checkout@master
15+
- name: Run linter
16+
uses: golangci/golangci-lint-action@v3
17+
with:
18+
version: v1.51
19+
args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s

0 commit comments

Comments
 (0)