Skip to content

Commit a3088c8

Browse files
authored
fix: ensure jq is installed and add coverage generation in GitHub Actions (#1238)
# Description This PR addresses two issues: 1. Ensuring that `jq` is installed before using it in the Makefile. 2. Adding a `make coverage` step in the GitHub Actions workflow to generate coverage files prior to uploading artifacts. ## Related Issue #688 `ci: minor bugs in "Test Retina Image" pipeline` ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Changes - Add a check in the Makefile to fail early if `jq` is not found on the system. - Update the GitHub Actions workflow to run `make coverage` before the coverage artifacts are uploaded. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Yerlan Baiturinov <[email protected]>
1 parent 2d30432 commit a3088c8

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/test.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
pull_request:
88
branches: [main]
99
workflow_dispatch:
10+
1011
permissions:
1112
actions: read
1213
contents: read
@@ -15,6 +16,7 @@ permissions:
1516
pull-requests: write
1617
security-events: write
1718
issues: write
19+
1820
jobs:
1921
test-image:
2022
runs-on: ubuntu-latest
@@ -32,8 +34,9 @@ jobs:
3234
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
3335
run: |
3436
make test-image IMAGE_NAMESPACE=${{ github.repository }} PLATFORM=linux/amd64
37+
3538
- name: Upload Artifacts
3639
uses: actions/upload-artifact@v4
3740
with:
3841
name: coverage-files
39-
path: ./coverage*
42+
path: ./output/coverage*

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ container-docker: buildx # util target to build container images using docker bu
241241
image_metadata_filename="image-metadata-$$image_name-$(TAG).json"; \
242242
touch $$image_metadata_filename; \
243243
echo "Building $$image_name for $$os/$$arch "; \
244+
mkdir -p $(OUTPUT_DIR); \
244245
docker buildx build \
245246
--platform $(PLATFORM) \
246247
--metadata-file=$$image_metadata_filename \
@@ -253,6 +254,7 @@ container-docker: buildx # util target to build container images using docker bu
253254
--build-arg VERSION=$(VERSION) $(EXTRA_BUILD_ARGS) \
254255
--target=$(TARGET) \
255256
-t $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) \
257+
--output type=local,dest=$(OUTPUT_DIR) \
256258
$(BUILDX_ACTION) \
257259
$(CONTEXT_DIR)
258260

test/image/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM mcr.microsoft.com/oss/go/microsoft/golang@sha256:88225e171f29fe5f1f6ffca8eb
44
ENV CGO_ENABLED=0
55
COPY . /go/src/github.com/microsoft/retina
66
WORKDIR /go/src/github.com/microsoft/retina
7-
RUN tdnf install -y clang16 lld16 bpftool libbpf-devel make git
7+
RUN tdnf install -y clang16 lld16 bpftool libbpf-devel make git jq
88
RUN go generate /go/src/github.com/microsoft/retina/pkg/plugin/...
99
# RUN go mod edit -module retina
1010
# RUN make all generate

0 commit comments

Comments
 (0)