feat: issue template and ci/cd (#2)

Merge pull request #2 from versenilvis/dev
This commit is contained in:
VERSE
2026-05-09 12:14:28 -07:00
committed by GitHub
13 changed files with 283 additions and 42 deletions
+51
View File
@@ -0,0 +1,51 @@
name: Bug Report
description: Report a bug
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to help everyone identify and fix the bug
- type: textarea
id: description
attributes:
label: Describe your issue
placeholder: When I click here this happens
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
placeholder: |
1. Enhance this function
2. Refactor this
3. Refactor that
validations:
required: true
- type: textarea
id: expected
attributes:
label: What was the expected result?
placeholder: I expected this to happen
- type: textarea
id: screenshots
attributes:
label: Put here any screenshots or videos (optional)
- type: textarea
id: deviceinfo
attributes:
label: Your OS and Browser (optional)
placeholder: |
- OS: Windows 10
- Browser: Chrome 90.0
- type: dropdown
id: assign
attributes:
label: "Would you like to work on this issue?"
options:
- "Yes"
- type: markdown
attributes:
value: |
Thanks for reporting this issue! We will get back to you as soon as possible.
+36
View File
@@ -0,0 +1,36 @@
name: New feature
description: Suggest or request a new feature
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to properly describe the new feature you are suggesting.
- type: textarea
id: description
attributes:
label: Describe the feature
placeholder: A feature X that allows to do Y
validations:
required: true
- type: textarea
id: rationale
attributes:
label: It should be implemented because
placeholder: It will allow to do Y that is needed for Z
- type: textarea
id: context
attributes:
label: Additional context
placeholder: |
Add any other context or screenshots about the feature request here.
- type: dropdown
id: assign
attributes:
label: "Would you like to work on this issue?"
options:
- "Yes"
- type: markdown
attributes:
value: |
Thanks for your suggestion! Let's see together if it can be implemented.
+17
View File
@@ -0,0 +1,17 @@
# Issues template
I created this template to help you report bugs or suggest new features more easily without having to manually write them.
If you have any questions, please submit a Pull Request (PR) or open Issues.
If you can improve my issues template, please open a PR.
<img width="1163" height="364" alt="image" src="https://github.com/user-attachments/assets/125eb950-c5c1-4762-b02d-4f8fb3a5ceaf" />
<div align="center"><i>You can choose one of these three</i></div>
<img width="1992" height="1323" alt="image" src="https://github.com/user-attachments/assets/f63014ee-fac5-4c0e-b846-8f168ca42921" />
<div align="center"><i>Bug Report</i></div>
<img width="2027" height="1326" alt="image" src="https://github.com/user-attachments/assets/7ecd00a9-0457-4980-88c6-91ec849f67b0" />
<div align="center"><i>New Feature</i></div>
+94
View File
@@ -0,0 +1,94 @@
name: Release
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches: [ '**' ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
quality-and-release:
name: Quality & Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Tidy
run: go mod tidy
- name: Run Linter
uses: golangci/golangci-lint-action@v8
with:
version: v2.11.4
- name: Run Tests
run: go test -v ./...
- name: Build Binaries
if: startsWith(github.ref, 'refs/tags/v')
run: |
mkdir -p dist
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64")
for platform in "${platforms[@]}"; do
os_arch=(${platform//\// })
GOOS=${os_arch[0]}
GOARCH=${os_arch[1]}
output_name="iris"
[ "$GOOS" == "windows" ] && output_name="iris.exe"
echo "Building $GOOS/$GOARCH..."
GOOS=$GOOS GOARCH=$GOARCH go build \
-ldflags="-s -w -X github.com/versenilvis/iris/root.Version=${{ github.ref_name }}" \
-trimpath -o "dist/$output_name" main.go
cd dist
tar -czf "iris_${GOOS}_${GOARCH}.tar.gz" "$output_name"
rm "$output_name"
cd ..
done
- name: Prepare Release Notes
if: startsWith(github.ref, 'refs/tags/v')
run: |
# Generate standard GitHub release notes
GEN_NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} --jq .body)
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
echo "$GEN_NOTES" >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
echo "## Installation" >> $GITHUB_ENV
echo "\`\`\`bash" >> $GITHUB_ENV
echo "curl -sS https://raw.githubusercontent.com/versenilvis/iris/main/scripts/install.sh | sudo sh" >> $GITHUB_ENV
echo "\`\`\`" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
body: ${{ env.RELEASE_BODY }}
files: dist/*.tar.gz
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+26
View File
@@ -0,0 +1,26 @@
name: Spelling
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
env:
CLICOLOR: 1
jobs:
spelling:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Spell Check Repo
uses: crate-ci/typos@v1.29.4
+35 -27
View File
@@ -1,35 +1,43 @@
version: 2
version: "2"
run:
timeout: 5m
tests: true
timeout: 5m
tests: true
linters:
disable-all: true
enable:
- errcheck
- govet
- staticcheck
- errorlint
- errname
- bodyclose
- sqlclosecheck
- noctx
- ineffassign
- unconvert
- bidichk
linters-settings:
default: none
enable:
- errcheck
- govet
- staticcheck
- errorlint
- errname
- bodyclose
- sqlclosecheck
- noctx
- ineffassign
- unconvert
- bidichk
settings:
errcheck:
check-type-assertions: true
check-blank: true
check-type-assertions: true
check-blank: false
exclude-functions:
- fmt.Print
- fmt.Println
- fmt.Printf
- fmt.Fprint
- fmt.Fprintln
- fmt.Fprintf
govet:
enable-all: true
disable:
- fieldalignment
enable-all: true
disable:
- fieldalignment
exclusions:
rules:
- linters: [errcheck]
source: "^\\s*defer "
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
max-issues-per-linter: 0
max-same-issues: 0
+2
View File
@@ -0,0 +1,2 @@
[default.extend-words]
hel = "hel"
+1 -5
View File
@@ -1,6 +1,6 @@
module github.com/versenilvis/iris
go 1.26.1
go 1.24.0
require (
github.com/charmbracelet/lipgloss v1.1.0
@@ -29,7 +29,3 @@ require (
github.com/spf13/pflag v1.0.10 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
)
// this is my personal project, I want to point to my local folder to debug and develop
// the github version is the stable one
replace github.com/versenilvis/fuzzy => ../fuzzy
+2
View File
@@ -37,6 +37,8 @@ github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiT
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/versenilvis/fuzzy v0.1.0-rc h1:QfEBVtjSFPklFeLP4cxLLpjDNauOyzcegYvyI2tT7UY=
github.com/versenilvis/fuzzy v0.1.0-rc/go.mod h1:TCgCwxBa4px8NhCXH8SPePCyJsf/qPsl1i+G/HDdjyg=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
+4 -1
View File
@@ -24,7 +24,10 @@ func NewServer() (*Server, error) {
return nil, err
}
localAddr := conn.LocalAddr().(*net.UDPAddr)
localAddr, ok := conn.LocalAddr().(*net.UDPAddr)
if !ok {
return nil, net.InvalidAddrError("not a UDP address")
}
s := &Server{
conn: conn,
+3 -3
View File
@@ -121,7 +121,7 @@ func runWrapper() {
case syscall.SIGWINCH:
_ = pty.InheritSize(os.Stdin, ptmx) // handle terminal window resize
// this is the core feature of reloading
// it helps IRIS reload itself that you dont need to restart the shell mannually
// it helps IRIS reload itself that you dont need to restart the shell manually
// SIGUSR1 is the signal to active reload when you type "just reload"
case syscall.SIGUSR1:
// trigger iris reload by executing itself again
@@ -508,10 +508,10 @@ func runWrapper() {
_, _ = ptmx.Write([]byte{0x15}) // ctrl+u to clear line
_, _ = ptmx.Write([]byte(selected))
overlay.Cursor = 0 // this prevents when you tab, it switchs between suggestions non-stop
overlay.Cursor = 0 // this prevents when you tab, it switches between suggestions non-stop
shouldOverlayDraw = true // <- rerender after tab to choose, if you set to false,
// when you press tab continuely, it will print all folder from menu suggestions
// when you press tab continually, it will print all folder from menu suggestions
// and make the cursor jump to next line
userNavigated = false
}
+7 -3
View File
@@ -22,10 +22,14 @@ func TestGitSuggestions(t *testing.T) {
ctx := context.Background()
// Initialize git repo
_ = exec.CommandContext(ctx, "git", "init").Run()
_ = exec.CommandContext(ctx, "git", "config", "user.email", "iris-test@example.com").Run() // this is for ci/cd
_ = exec.CommandContext(ctx, "git", "config", "user.name", "Iris Test").Run() // this is for ci/cd
_ = os.WriteFile(filepath.Join(tmp, "file.go"), []byte("package main"), 0644)
_ = exec.CommandContext(ctx, "git", "add", ".").Run()
_ = exec.CommandContext(ctx, "git", "commit", "-m", "initial").Run()
// Create branches
_ = exec.CommandContext(ctx, "git", "branch", "feature/login").Run()
_ = exec.CommandContext(ctx, "git", "branch", "dev").Run()
@@ -87,7 +91,7 @@ func TestGitSuggestions(t *testing.T) {
t.Run("git reset options", func(t *testing.T) {
// git reset --soft origin/main -> should be accepted (just testing lookup doesn't crash)
_ = core.Lookup("git reset --soft origin/main ")
// git reset HEAD -> show files
res := core.Lookup("git reset HEAD ")
found := false
@@ -145,7 +149,7 @@ func TestGitSuggestions(t *testing.T) {
// find current branch
out, _ := exec.CommandContext(ctx, "git", "rev-parse", "--abbrev-ref", "HEAD").Output()
current := strings.TrimSpace(string(out))
res := core.Lookup("git checkout ")
for _, r := range res {
if strings.Contains(r.Cmd, current) && !strings.Contains(r.Cmd, "remotes/") {
+5 -3
View File
@@ -37,12 +37,14 @@ func TestUpdateState(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpDir)
defer func() { _ = os.RemoveAll(tmpDir) }()
// Override home dir for testing
homeBackup := os.Getenv("HOME")
os.Setenv("HOME", tmpDir)
defer os.Setenv("HOME", homeBackup)
if err := os.Setenv("HOME", tmpDir); err != nil {
t.Fatal(err)
}
defer func() { _ = os.Setenv("HOME", homeBackup) }()
// Ensure .iris directory exists
_ = os.MkdirAll(filepath.Join(tmpDir, ".iris"), 0755)