Repository navigation
add tests #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add tests #14
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
41161a5
add tests
nett00n 3c46349
update pipelines
nett00n 679fa13
fix typo
nett00n 88e3f81
linting fixes
nett00n 13d8da4
workflows fixxes
nett00n 6e50264
pin lint versions
nett00n e63960d
simplify .golangci.yml as fck
nett00n de4411b
one more
nett00n c6b2589
lint improvements
nett00n 1e3ba05
add windows tests
nett00n aa477a2
More tests to tests god
nett00n a68bfab
upd
nett00n 25a2ce0
еуыештп-еуыештп-еуыештп
nett00n e854be9
lint
nett00n 0ed1900
disable test coverage threshold
nett00n 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 hidden or 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,44 @@ | ||
| # .codecov.yml | ||
|
|
||
| codecov: | ||
| require_ci_to_pass: true | ||
| notify: | ||
| wait_for_ci: true | ||
|
|
||
| coverage: | ||
| precision: 2 | ||
| round: down | ||
| range: "70...100" | ||
|
|
||
| status: | ||
| project: | ||
| default: | ||
| target: 70% | ||
| threshold: 5% | ||
| base: auto | ||
| patch: | ||
| default: | ||
| target: 70% | ||
| threshold: 5% | ||
|
|
||
| ignore: | ||
| - "**/*_test.go" | ||
| - "**/testdata/**" | ||
| - "build/**" | ||
| - "_assets/**" | ||
|
|
||
| flags: | ||
| windows: | ||
| paths: | ||
| - "." | ||
| carryforward: true | ||
|
|
||
| comment: | ||
| layout: "header, diff, flags, files, footer" | ||
| behavior: default | ||
| require_changes: false | ||
| require_base: false | ||
| require_head: true | ||
|
|
||
| github_checks: | ||
| annotations: true |
This file contains hidden or 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 hidden or 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 hidden or 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,69 @@ | ||
| # dependency-review.yml | ||
|
|
||
| name: Dependency Review | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| name: Review Dependencies | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Dependency Review | ||
| uses: actions/dependency-review-action@v4 | ||
| with: | ||
| comment-summary-in-pr: always | ||
| fail-on-severity: moderate | ||
| fail-on-scopes: runtime | ||
| base-ref: ${{ github.event.pull_request.base.sha }} | ||
| head-ref: ${{ github.event.pull_request.head.sha }} | ||
|
|
||
| license-check: | ||
| name: License Compatibility Check | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.25' | ||
|
|
||
| - name: Install go-licenses | ||
| run: go install github.com/google/go-licenses@latest | ||
|
|
||
| - name: Check licenses | ||
| run: | | ||
| echo "Checking licenses for all dependencies..." | ||
| go-licenses report ./... --template licenses.tpl > licenses-report.txt || true | ||
|
|
||
| # Check for incompatible licenses (add more as needed) | ||
| INCOMPATIBLE_LICENSES=("GPL-3.0" "AGPL-3.0" "LGPL-3.0") | ||
|
|
||
| for license in "${INCOMPATIBLE_LICENSES[@]}"; do | ||
| if grep -q "$license" licenses-report.txt; then | ||
| echo "WARNING: Found potentially incompatible license: $license" | ||
| grep "$license" licenses-report.txt | ||
| fi | ||
| done | ||
|
|
||
| echo "License check completed. See licenses-report.txt for details." | ||
|
|
||
| - name: Upload license report | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: license-report | ||
| path: licenses-report.txt | ||
| retention-days: 30 |
This file contains hidden or 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,120 @@ | ||
| # security.yml | ||
|
|
||
| name: Security Scan | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| schedule: | ||
| # Run security scan weekly on Sundays at 2 AM UTC | ||
| - cron: '0 2 * * 0' | ||
|
|
||
| # Security scanning with reliable, built-in tools: | ||
| # - govulncheck: Official Go vulnerability database scanner | ||
| # - CodeQL: GitHub's semantic code analysis | ||
| # - staticcheck: Advanced static analysis (honnef.co/go/tools) | ||
| # - go vet: Built-in Go static analyzer | ||
|
|
||
| jobs: | ||
| govulncheck: | ||
| name: Go Vulnerability Check | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.25' | ||
|
|
||
| - name: Install govulncheck | ||
| run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
|
|
||
| - name: Run govulncheck | ||
| run: govulncheck ./... | ||
|
|
||
| codeql: | ||
| name: CodeQL Analysis | ||
| runs-on: windows-latest | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: go | ||
| queries: +security-and-quality | ||
|
|
||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v3 | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:go" | ||
|
|
||
| dependency-scan: | ||
| name: Dependency Vulnerability Scan | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.25' | ||
|
|
||
| - name: Install dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Run go mod audit (built-in vulnerability check) | ||
| run: | | ||
| echo "Checking for known vulnerabilities in dependencies..." | ||
| go list -json -deps ./... | findstr "Module" || echo "Dependency scan completed" | ||
| echo "Note: Using govulncheck for comprehensive vulnerability analysis" | ||
| continue-on-error: true | ||
|
|
||
| static-analysis: | ||
| name: Static Security Analysis | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.25' | ||
|
|
||
| - name: Install staticcheck | ||
| run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||
|
|
||
| - name: Run staticcheck security analysis | ||
| run: staticcheck -f sarif ./... > staticcheck-results.sarif | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload staticcheck SARIF file | ||
| if: always() && hashFiles('staticcheck-results.sarif') != '' | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: staticcheck-results.sarif | ||
| category: staticcheck | ||
|
|
||
| - name: Run go vet security analysis | ||
| run: | | ||
| echo "Running go vet for security analysis..." | ||
| go vet ./... || echo "go vet completed with findings" | ||
| continue-on-error: true | ||
Oops, something went wrong.
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.
🧩 Analysis chain
Don’t hardcode Go 1.25; align with go.mod.
Use setup-go’s go-version-file to follow the repo’s declared version; avoids breakage if 1.25 isn’t available.
Apply:
Also applies to: 74-78, 97-101
🏁 Script executed:
Length of output: 11
🌐 Web query:
💡 Result:
Yes — Go 1.25 is released (go1.25.0 released August 12, 2025) and the official Go site shows the 1.25 release. [1]
actions/setup-go@v5 can install any Go release listed in the actions/go-versions manifest (and will download versions JIT if not in the runner image), so you can use setup-go@v5 with go-version: '1.25' (or 'stable') to get Go 1.25. [2][3]
Sources:
Align workflow Go version to go.mod (don't hardcode 1.25).
go.mod declares "go 1.23.1" while the workflow hardcodes 1.25 — replace the hardcoded go-version with setup-go's go-version-file to follow go.mod and avoid CI/toolchain drift.
Applies to: .github/workflows/security.yml — lines 29-33, 74-78, 97-101.
📝 Committable suggestion
🤖 Prompt for AI Agents