Skip to content
Closed
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
43 changes: 18 additions & 25 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,23 @@ on:
branches: ['*']

jobs:
build-test:
name: Build, lint, test
test-multiarch-image-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.25'
- name: Install make
run: sudo apt -y install make
- name: run build
run: make build && git diff --exit-code
- name: run unit tests
run: make test coverage-report
- name: check clean vendors
run: go mod vendor
- name: Report coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cover.out
flags: unittests
fail_ci_if_error: false
verbose: true
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: '1.25'
-
name: Set up QEMU dependency
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: checkout
uses: actions/checkout@v3
- name: build and push manifest with images
run: |
MULTIARCH_TARGETS="arm64" IMAGE_ORG=netobserv VERSION=test CLEAN_BUILD=1 make image-build
41 changes: 0 additions & 41 deletions .github/workflows/pull_request_e2e.yml

This file was deleted.

35 changes: 0 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
ARG TARGETARCH=amd64

# Build the manager binary
FROM docker.io/library/golang:1.25 as builder

ARG TARGETARCH
ARG LDFLAGS

WORKDIR /opt/app-root

COPY cmd cmd
COPY internal internal
COPY main.go main.go
COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor/ vendor/

# Build collector
RUN GOARCH=$TARGETARCH go build -ldflags "$LDFLAGS" -mod vendor -a -o build/network-observability-cli

# We still need Makefile & resources for oc-commands; copy them after go build for caching
COPY commands/ commands/
COPY res/ res/
COPY scripts/ scripts/
COPY Makefile Makefile
COPY .mk/ .mk/

# Embed commands in case users want to pull it from collector image
RUN USER=netobserv VERSION=main make oc-commands

# Prepare output dir
RUN mkdir -p output

# Create final image from ubi + built binary and command
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.7-1769056855

Expand All @@ -40,8 +9,4 @@ RUN microdnf install -y tar && \

WORKDIR /

COPY --from=builder /opt/app-root/build .
COPY --from=builder --chown=65532:65532 /opt/app-root/output /output
USER 65532:65532

ENTRYPOINT ["/network-observability-cli"]
Loading