Skip to content

fix: correct GitHub URL to sadewadee/whm2bunny #9

fix: correct GitHub URL to sadewadee/whm2bunny

fix: correct GitHub URL to sadewadee/whm2bunny #9

Workflow file for this run

name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
name: Test (Go ${{ matrix.go }})
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.21', '1.22', '1.23']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Run go vet
run: go vet ./...
- name: Run go fmt check
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Code is not formatted. Run 'go fmt ./...'"
gofmt -d .
exit 1
fi
- name: Run tests
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage
uses: codecov/codecov-action@v4
if: matrix.go == '1.22'
with:
files: ./coverage.out
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...
- name: Run Govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
build:
name: Build Verification
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Build binary
run: go build -v -o whm2bunny ./cmd/whm2bunny
- name: Verify binary
run: |
./whm2bunny version
./whm2bunny --help
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: whm2bunny-linux-amd64
path: whm2bunny
retention-days: 7