SettingsSentry uses Go modules for dependency management. The project dependencies are defined in the go.mod file and are vendored for reproducible builds.
To update dependencies to their latest versions:
go get -u ./...
go mod tidy
go mod vendorTo build using vendored dependencies:
go build -mod=vendorA Makefile is provided for common development tasks:
# Build the application
make build
# Run tests
make test
# Run linter
make lint
# Clean build artifacts
make clean
# Create a release (requires GoReleaser)
make releaseThis document provides instructions for building, testing, and developing SettingsSentry.
- macOS (10.15 Catalina or newer)
- Go 1.16 or newer
- Homebrew (for installing dependencies)
-
Install Go:
brew install go
-
Install development tools:
brew install golangci-lint goreleaser
To build the application:
make buildOr manually:
go build -o settingssentryTo create a ZIP archive with the executable and configuration files:
make zipOr manually:
./build.shTo create a macOS DMG installer:
make dmgSettingsSentry includes a comprehensive test suite. Here's how to run the tests:
To run all unit tests:
make testOr manually:
go test ./...To run tests in a specific package:
go test ./cronTo run a specific test:
go test -run TestParseConfigIntegration tests are tagged and can be run with:
go test -tags=integrationTo generate a test coverage report:
make coverageOr manually:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outOverall Coverage: 46.3% (after refactoring for testability)
Coverage by package:
logger: 93.8% ✅cron: 89.9% ✅interfaces: 84.6% ✅command: 83.9% ✅printer: 80.0% ✅config: 73.7% 🟡util: 55.6% 🟡backup: 49.9% 🟡main: 0.0% 🔴 (refactored for testability, tests to be added)
Note: The main package was recently refactored to improve testability by:
- Extracting CLI logic into
main_cli.gowith testable methods - Converting
main()to userun()function that returns errors - Creating
BackupContextinpkg/backup/backup_operations.gofor dependency injection
These refactorings enable comprehensive testing and are targeted to achieve 80%+ coverage in the next phase.
To run the linter:
make lintOr manually:
golangci-lint runSettingsSentry uses GitHub Actions for continuous integration and deployment, specifically designed for macOS:
-
CI Workflow: Runs on every push to main and pull requests. It includes:
- Linting with golangci-lint
- Running tests with race detection
- Building the application
-
Release Workflow: Triggered when a new tag is pushed. It:
- Runs tests
- Builds macOS binaries for both Intel and Apple Silicon
- Creates a macOS DMG installer
- Creates a ZIP archive with the executable and configuration files
- Publishes GitHub releases with assets
-
Security Scanning: CodeQL analysis for security vulnerabilities
See the .github/workflows directory for the workflow definitions.