From a2fb960ff22b331e305b6aab405ae29ad68b4bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Alejandro=20Marug=C3=A1n?= Date: Thu, 15 Aug 2024 15:08:22 +0200 Subject: [PATCH] chore: check coverage image with dive closes #11 --- .github/workflows/check-changes.yaml | 29 +++++++++++++++++++ .gitignore | 2 ++ CONTRIBUTING.md | 42 +++++++++++++++++++++++++++- LICENSE | 2 +- 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-changes.yaml b/.github/workflows/check-changes.yaml index 308dac9..97b036c 100644 --- a/.github/workflows/check-changes.yaml +++ b/.github/workflows/check-changes.yaml @@ -14,6 +14,12 @@ jobs: with: fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Get current tag id: current_release run: | @@ -98,6 +104,29 @@ jobs: echo -e "$body" > pr-output.log + - name: "Build and push Docker image" + uses: docker/build-push-action@v6 + with: + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + context: . + platforms: linux/amd64 + push: false + tags: kafka-cruise-control-${{ env.GITHUB_JOB }} + + - name: Show changes + if: steps.check_changes.outputs.release_changed == 'true' + run: | + # install dive + mkdir dive && cd dive + wget https://github.com/wagoodman/dive/releases/download/v${{ vars.DIVE_VERSION }}/dive_${{ vars.DIVE_VERSION }}_linux_amd64.tar.gz + tar xzvf dive_${{ vars.DIVE_VERSION }}_linux_amd64.tar.gz + cd .. + + # dive + echo -e "\n## Dive output\n" >> pr-output.log + ./dive/dive -t kafka-cruise-control-${{ env.GITHUB_JOB }} >> pr-output.log + - name: Create PR changes if: steps.check_changes.outputs.release_changed == 'true' uses: peter-evans/create-pull-request@v6 diff --git a/.gitignore b/.gitignore index 5f25650..6571a11 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ pr-output.log +dive +dive/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1333ed7..024f64d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,41 @@ -TODO +# How to contribute to Cruise Control + +This document provides guidelines for contributing to the *Cruise Control* project. + +## How can I contribute? + +### Did you find a bug? + +* **Ensure the bug has not already been reported** by searching on GitHub under [Issues](https://github.com/devops-ia/kafka-cruise-control/issues). +* If you cannot find an open issue addressing the problem, [open a new one](https://github.com/devops-ia/kafka-cruise-control/issues/new). Include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the unexpected behavior. +* Use the relevant bug report templates to create the issue, if available. + +### Do you intend to add a new feature or change an existing one? + +* Please discuss first ([open an issue](https://github.com/devops-ia/kafka-cruise-control/issues)) before starting any significant pull request (e.g., implementing features, refactoring code) to avoid spending time on something that might not be merged. +* Adhere to the project's coding conventions (indentation, accurate comments, etc.) and any other requirements (such as test coverage, documentation). + +## Styleguides + +### YAML Styleguide + +All YAML files must adhere to the following style guide: + +* Indentation: Use 2 spaces for indentation. +* No trailing spaces. +* Use hyphens for list items. +* Use camelCase for key names. +* Ensure there are no syntax errors. + +Additional rules: + +* Always use double quotes for strings. +* Keep lines to a maximum of 80 characters. +* Ensure proper alignment of nested elements. + +### Git Commit Messages + +* Use the present tense ("Add feature" not "Added feature"). +* Use the imperative mood ("Move cursor to..." not "Moves cursor to..."). +* Limit the first line to 72 characters or less. +* Reference issues and pull requests liberally after the first line. diff --git a/LICENSE b/LICENSE index 479972a..32c75fe 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 DevOps Solutions +Copyright (c) 2024 DevOps Solutions Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal