mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-08 22:08:03 -05:00
## CHANGES - Upgrade GitHub Actions to latest versions (v6, v21) - Add modernization check step in CI workflow - Replace strings manipulation with `strings.CutPrefix` and `strings.CutSuffix` - Replace manual loops with `slices.Contains` for validation - Use `strings.SplitSeq` for iterator-based string splitting - Replace `bytes.TrimPrefix` with `bytes.CutPrefix` for clarity - Use `strings.Builder` instead of string concatenation - Replace `fmt.Sprintf` with `fmt.Appendf` for efficiency - Simplify padding calculation with `max` builtin
42 lines
859 B
YAML
42 lines
859 B
YAML
name: Go Build
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths-ignore:
|
|
- "data/patterns/**"
|
|
- "**/*.md"
|
|
pull_request:
|
|
branches: ["main"]
|
|
paths-ignore:
|
|
- "data/patterns/**"
|
|
- "**/*.md"
|
|
|
|
jobs:
|
|
test:
|
|
name: Run tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: ./go.mod
|
|
|
|
- name: Run tests
|
|
run: go test -v ./...
|
|
|
|
- name: Check for modernization opportunities
|
|
run: |
|
|
go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest ./...
|
|
|
|
- name: Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@v21
|
|
|
|
- name: Check Formatting
|
|
run: nix flake check
|