From a2ca03705c537b82646e4d1bfd1e51fca7502b8b Mon Sep 17 00:00:00 2001 From: Jan Medek Date: Wed, 18 Jun 2025 08:52:59 +0200 Subject: [PATCH 1/3] ci: add ceedling action --- action-ceedling-unit-test-master/LICENSE | 21 +++++++++++++ action-ceedling-unit-test-master/README.md | 30 +++++++++++++++++++ action-ceedling-unit-test-master/action.yml | 17 +++++++++++ .../entrypoint.sh | 15 ++++++++++ 4 files changed, 83 insertions(+) create mode 100644 action-ceedling-unit-test-master/LICENSE create mode 100644 action-ceedling-unit-test-master/README.md create mode 100644 action-ceedling-unit-test-master/action.yml create mode 100644 action-ceedling-unit-test-master/entrypoint.sh diff --git a/action-ceedling-unit-test-master/LICENSE b/action-ceedling-unit-test-master/LICENSE new file mode 100644 index 0000000..744610b --- /dev/null +++ b/action-ceedling-unit-test-master/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Simon Scurrell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/action-ceedling-unit-test-master/README.md b/action-ceedling-unit-test-master/README.md new file mode 100644 index 0000000..9e7ff52 --- /dev/null +++ b/action-ceedling-unit-test-master/README.md @@ -0,0 +1,30 @@ +## action-ceedling-unit-test +Github action for running unit tests using Ceedling + +## Inputs + +### `unit-test-path` + +**Required** Absolute path to the Ceedling project yaml file. + +## Example Usage +```yaml +name: Unit Tests +on: + push: + branches: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Run Unit Tests + uses: sjscymru/action-ceedling-unit-test@v1.0 + with: + unit-test-path: '${{ github.workspace }}/unit_tests' +``` diff --git a/action-ceedling-unit-test-master/action.yml b/action-ceedling-unit-test-master/action.yml new file mode 100644 index 0000000..92c8b54 --- /dev/null +++ b/action-ceedling-unit-test-master/action.yml @@ -0,0 +1,17 @@ +name: 'Run Ceedling Unit Tests' +description: 'Run the unit test using Ceedling framework' +inputs: + unit-test-path: # path to Ceedling project.yml file + description: 'Path to Ceedling project.yml file' + required: true + +runs: + using: 'composite' + steps: + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7.1' + - run: chmod +x ${{ github.action_path }}/entrypoint.sh + shell: bash + - run: ${{ github.action_path }}/entrypoint.sh ${{ inputs.unit-test-path }} + shell: bash diff --git a/action-ceedling-unit-test-master/entrypoint.sh b/action-ceedling-unit-test-master/entrypoint.sh new file mode 100644 index 0000000..8ad86fc --- /dev/null +++ b/action-ceedling-unit-test-master/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Install dependencies +sudo apt-get update +sudo apt-get install -y coreutils gcc gcc-multilib gcovr valgrind libc-dev + +# Install ceedling +sudo gem install --force ceedling:0.31.1 + +# Navigate to unit tests +echo 'Attempting to run unit tests at location:' $1 +cd $1 + +# Run unit tests +ceedling test:all From cfff431a5c3b3dd8c56887ff0a98d816ca25e3a3 Mon Sep 17 00:00:00 2001 From: Jan Medek Date: Wed, 18 Jun 2025 08:55:16 +0200 Subject: [PATCH 2/3] build(ceedling): Update entrypoint.sh with code coverage call --- action-ceedling-unit-test-master/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action-ceedling-unit-test-master/entrypoint.sh b/action-ceedling-unit-test-master/entrypoint.sh index 8ad86fc..f0d0fe7 100644 --- a/action-ceedling-unit-test-master/entrypoint.sh +++ b/action-ceedling-unit-test-master/entrypoint.sh @@ -12,4 +12,5 @@ echo 'Attempting to run unit tests at location:' $1 cd $1 # Run unit tests -ceedling test:all +# ceedling test:all +ceedling gcov:all utils:gcov From 477a1356ec7acb4f19fbc8bb46589e3dd82561e7 Mon Sep 17 00:00:00 2001 From: Jan Medek Date: Wed, 18 Jun 2025 08:58:32 +0200 Subject: [PATCH 3/3] refactor(ceedling): remove "-master" from action name --- .../LICENSE | 0 .../README.md | 0 .../action.yml | 0 .../entrypoint.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {action-ceedling-unit-test-master => action-ceedling-unit-test}/LICENSE (100%) rename {action-ceedling-unit-test-master => action-ceedling-unit-test}/README.md (100%) rename {action-ceedling-unit-test-master => action-ceedling-unit-test}/action.yml (100%) rename {action-ceedling-unit-test-master => action-ceedling-unit-test}/entrypoint.sh (100%) diff --git a/action-ceedling-unit-test-master/LICENSE b/action-ceedling-unit-test/LICENSE similarity index 100% rename from action-ceedling-unit-test-master/LICENSE rename to action-ceedling-unit-test/LICENSE diff --git a/action-ceedling-unit-test-master/README.md b/action-ceedling-unit-test/README.md similarity index 100% rename from action-ceedling-unit-test-master/README.md rename to action-ceedling-unit-test/README.md diff --git a/action-ceedling-unit-test-master/action.yml b/action-ceedling-unit-test/action.yml similarity index 100% rename from action-ceedling-unit-test-master/action.yml rename to action-ceedling-unit-test/action.yml diff --git a/action-ceedling-unit-test-master/entrypoint.sh b/action-ceedling-unit-test/entrypoint.sh similarity index 100% rename from action-ceedling-unit-test-master/entrypoint.sh rename to action-ceedling-unit-test/entrypoint.sh