Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Code Quality

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true

- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0

- name: Check formatting
run: |
# Run gofmt to format code
make fmt

# Check if any files were modified
if [ -n "$(git status --porcelain)" ]; then
echo "❌ Code formatting issues detected. Please run 'make fmt' locally and commit the changes."
echo ""
echo "Files that need formatting:"
git status --porcelain
echo ""
echo "Differences:"
git diff
exit 1
fi
echo "✅ All files are properly formatted"

- name: Run go vet
run: make vet

- name: Run golangci-lint
run: make lint
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true

- name: Download dependencies
run: go mod download

- name: Run unit tests
run: make test
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ issues:
max-same-issues: 0

output:
formats:
colored-line-number:
path: stdout
print-issued-lines: true
print-linter-name: true
sort-results: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN echo "Building for ${TARGETOS}/${TARGETARCH}" && \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
-ldflags "-w -s -X main.version=${VERSION} -X main.gitCommit=${GIT_COMMIT} -X main.buildDate=${BUILD_DATE}" \
-o roxie \
./cmd/roxie
./cmd

# Stage 2: Runtime image based on Red Hat UBI Minimal
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"-X main.buildDate=1970-01-01T00:00:00Z"
];

subPackages = [ "cmd/roxie" ];
subPackages = [ "cmd" ];

meta = with pkgs.lib; {
description = "Fast, developer-friendly CLI to deploy and manage Red Hat Advanced Cluster Security (ACS)";
Expand Down