From 6ba6285f5107c5b801999d0251ab4f2354ec966e Mon Sep 17 00:00:00 2001 From: ESCristiano Date: Fri, 29 Sep 2023 18:16:21 +0100 Subject: [PATCH] feat(.github): Add Github Actions Signed-off-by: ESCristiano --- .github/CODEOWNERS | 2 + .github/CONTRIBUTORS | 4 ++ .github/ISSUE_TEMPLATE/bug_report.md | 27 ++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++ .github/pull_request_template.md | 55 +++++++++++++++++ .../templates/ISSUE_TEMPLATE/bug_report.md | 27 ++++++++ .../ISSUE_TEMPLATE/feature_request.md | 20 ++++++ .github/templates/pull_request_template.md | 61 +++++++++++++++++++ .github/workflows/base.yml | 35 +++++++++++ Makefile | 18 ++++++ 10 files changed, 269 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/CONTRIBUTORS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/templates/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/templates/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/templates/pull_request_template.md create mode 100644 .github/workflows/base.yml create mode 100644 Makefile diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..874b6ce --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Maintainers +* @ESCristiano @miguelafsilva5 diff --git a/.github/CONTRIBUTORS b/.github/CONTRIBUTORS new file mode 100644 index 0000000..d488903 --- /dev/null +++ b/.github/CONTRIBUTORS @@ -0,0 +1,4 @@ +# File with a list of people who contributed to this repository +# List sorted by first names. + +Cristiano Rodrigues \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..4792c76 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG] add short description of bug" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior : +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..c0ee87f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEAT-REQ] add short description of the feat-request" +labels: feature-request +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..1dcdc19 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,55 @@ +## PR Description + +Before saving the PR, please delete this description and add only your summary/description of the PR. +Please include a summary of the change that tries to answer the following general questions: +- What does this change introduces? Why is it required? +- Which main blocks are affected? + +If your changes are included in the following categories, please try also to answer to these specific questions if they enhance your summary: +- The PR changes introduces a new feature... + - What new feature is being introduced? + - Is the feature described in any of the requirements? +- The PR changes solves a bug... + - What bug does it solve? What was the previous behavior/warning/error? + - Is the bug described in any issue ticket number? +- The PR changes refactors a code/doc block... + - Why the code/doc block needed to be refactored? + - Is the improvement described in any issue ticket number? +- The PR changes the build system... + - What building block of the build system was changed? + - Has any external dependency introduced? +- The PR changes improves the overall performance of the system... + - Did you quantify the improvement on performance? Please share the numbers. +- The PR changes or adds new tests... + - What new tests were introduced or corrected? + +### Type of change + +Before saving the PR, please delete this description and the below options that are not relevant. +If you are not sure which type of change are you introducing, please read [Contributing](https://github.com/bao-project/bao-docs/blob/main/source/development/contributing.rst) documentation. + +- **feat**: introduces a new functionality + - Logical unit: +- **fix**: bug fix + - Logical unit: + - Fixes a specific issue: <#ticket-number> +- **ref**: refactoring of a code/doc block + - Logical unit: +- **build**: changes that affect the build system or external dependencies + - Logical unit: +- **doc**: documentation only changes + - Files affected: +- **perf**: a code change that improves performance + - Logical unit: +- **test**: adding missing tests or correcting existing ones + - Test unit/suite: +- **opt**: modifications pertaining only to optimizations + - Logical unit: +- **style**: changes that do not affect the meaning of the code (formatting, typos, naming, etc.) +- **update**: changes that brings a feature, setup, or configuration up to date by adding new or updated information + - Logical unit: + +## Checklist: + +- [ ] The changes generate no new warnings when building the project. If so, I have justified above. +- [ ] I have run the CI checkers before submitting the PR to avoid unnecessary runs of the workflow. diff --git a/.github/templates/ISSUE_TEMPLATE/bug_report.md b/.github/templates/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..4792c76 --- /dev/null +++ b/.github/templates/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG] add short description of bug" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior : +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/templates/ISSUE_TEMPLATE/feature_request.md b/.github/templates/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..c0ee87f --- /dev/null +++ b/.github/templates/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEAT-REQ] add short description of the feat-request" +labels: feature-request +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/templates/pull_request_template.md b/.github/templates/pull_request_template.md new file mode 100644 index 0000000..1e570b6 --- /dev/null +++ b/.github/templates/pull_request_template.md @@ -0,0 +1,61 @@ +## PR Description + +Before saving the PR, please delete this description and add only your summary/description of the PR. +Please include a summary of the change that tries to answer the following general questions: +- What does this change introduces? Why is it required? +- Which main blocks are affected? + +If your changes are included in the following categories, please try also to answer to these specific questions if they enhance your summary: +- The PR changes introduces a new feature... + - What new feature is being introduced? + - Is the feature described in any of the requirements? +- The PR changes solves a bug... + - What bug does it solve? What was the previous behavior/warning/error? + - Is the bug described in any issue ticket number? +- The PR changes refactors a code/doc block... + - Why the code/doc block needed to be refactored? + - Is the improvement described in any issue ticket number? +- The PR changes the build system... + - What building block of the build system was changed? + - Has any external dependency introduced? +- The PR changes improves the overall performance of the system... + - Did you quantify the improvement on performance? Please share the numbers. +- The PR changes or adds new tests... + - What new tests were introduced or corrected? + +### Type of change + +Before saving the PR, please delete this description and the below options that are not relevant. +If you are not sure which type of change are you introducing, please read [Contributing](https://github.com/bao-project/bao-docs/blob/main/source/development/contributing.rst) documentation. + +- **feat**: introduces a new functionality + - Logical unit: +- **fix**: bug fix + - Logical unit: + - Fixes a specific issue: <#ticket-number> +- **ref**: refactoring of a code/doc block + - Logical unit: +- **build**: changes that affect the build system or external dependencies + - Logical unit: +- **doc**: documentation only changes + - Files affected: +- **perf**: a code change that improves performance + - Logical unit: +- **test**: adding missing tests or correcting existing ones + - Test unit/suite: +- **opt**: modifications pertaining only to optimizations + - Logical unit: +- **ci**: changes to the CI configuration files and scripts + - CI checker unit: +- **style**: changes that do not affect the meaning of the code (formatting, typos, naming, etc.) +- **update**: changes that brings a feature, setup, or configuration up to date by adding new or updated information + - Logical unit: + +## Checklist: + +- [ ] The changes follows the documentation guidelines described in [here](https://github.com/bao-project/bao-docs/blob/main/source/development/doc_guidelines.rst). +- [ ] The changes follows the code documentation guidelines described in [here](https://github.com/bao-project/bao-docs/blob/main/source/development/code_documentation.rst). +- [ ] The changes follows the coding style guidelines described in [here](https://github.com/bao-project/bao-docs/blob/main/source/development/coding_style.rst). +- [ ] The changes follows the MISRA guidelines described in [here](https://github.com/bao-project/bao-docs/blob/main/source/development/misra.rst). +- [ ] The changes generate no new warnings when building the project. If so, I have justified above. +- [ ] I have run the CI checkers before submitting the PR to avoid unnecessary runs of the workflow. diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml new file mode 100644 index 0000000..6dabeba --- /dev/null +++ b/.github/workflows/base.yml @@ -0,0 +1,35 @@ +name: Bao nix workflow + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +jobs: + + gitlint: + runs-on: ubuntu-latest + container: baoproject/bao:latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: git config --global --add safe.directory $(realpath .) + - if: ${{ github.event_name == 'pull_request' }} + run: make gitlint GITLINT_BASE=${{ github.event.pull_request.base.sha }} + - if: ${{ github.event_name == 'push' }} + run: make gitlint GITLINT_BASE=${{ github.event.before }} + - if: ${{ github.event_name == 'workflow_dispatch' }} + run: make gitlint GITLINT_BASE=HEAD + + license: + runs-on: ubuntu-latest + container: baoproject/bao:latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - run: > + make license-check \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b936b44 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) Bao Project and Contributors. All rights reserved. + +SHELL:=bash + +root_dir:=$(realpath .) +src_dir:=$(root_dir)/pkgs + +# Instantiate CI rules +include ci/ci.mk + +nix_srcs+=$(shell find $(src_dir) -type f -name '*.nix') + +all_files:=$(nix_srcs) +$(call ci, license, "Apache-2.0", $(all_files)) + +ci: license-check +.PHONY: ci