Skip to content

Commit

Permalink
ci: Added linter workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Taras Drozdovskyi <[email protected]>
  • Loading branch information
tdrozdovsky committed Feb 21, 2024
1 parent c9b4363 commit 8fec8e5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: cpp-linter

on: [push, pull_request]

jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cpp-linter/cpp-linter-action@main
id: linter
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: ''
files-changed-only: false
ignore: crypto

- name: Fail fast?!
if: steps.linter.outputs.checks-failed != 0
run: |
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
# for actual deployment
# run: exit 1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Build](https://github.com/samsung/mtower/workflows/Build/badge.svg)](https://github.com/samsung/mtower/actions?query=workflow%3ABuild)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6108/badge)](https://bestpractices.coreinfrastructure.org/projects/6108)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Samsung/mTower/badge)](https://api.securityscorecards.dev/projects/github.com/Samsung/mTower)
[![cpp-linter](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/cpp-linter.yml/badge.svg)](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/cpp-linter.yml)
[![RepoSize](https://img.shields.io/github/repo-size/samsung/mtower.svg)](https://github.com/samsung/mtower)
[![Release](https://img.shields.io/github/v/release/samsung/mtower.svg)](https://github.com/samsung/mtower/releases)
[![LICENSE](https://img.shields.io/github/license/samsung/mtower.svg)](https://github.com/samsung/mtower/blob/master/LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion apps/hello_world/ca/hello_world_ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdio.h>
#include <string.h>

#include <tee_client_api.h>
#include "tee_client_api.h"

Check failure on line 32 in apps/hello_world/ca/hello_world_ns.c

View workflow job for this annotation

GitHub Actions / cpp-linter

apps/hello_world/ca/hello_world_ns.c:32:10 [clang-diagnostic-error]

'tee_client_api.h' file not found

/* To the the UUID (found the the TA's h-file(s)) */
#include <hello_world_ta.h>
Expand Down
2 changes: 2 additions & 0 deletions docs/mtower_test_suite_description.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## 1. Overview
mTower GP API test suite demonstrates the valid execution of relevant GP TEE API function implementations. As many of the functions depend on each other for successful operation, it is not reasonable to create a separate test for every possible combination of invalid parameters for each function in API, so, while the tests demonstrate behavior of API functions under some error conditions, most of the tests are concerned with correct use of functions, where returned results signal successful execution. Also note that many of the functions in Trusted part of TEE do not have full-fledged error handling mechanisms, as these functions are considered critical - that is, they must succeed, because it is impossible for system to recover if these functions fail. In such functions, error condition typically results in calling TEE_Panic() function, which writes an error message into log and drops the system into infinite loop, essentially hanging it.

**When adding or changing functionality, it is highly advisable to add new tests as part of your contribution.**

## 2. How to run
Start out by following the "Get and build the solution" in the [build.md] file.
> Warning: Need to download the toolchain (exec. `make toolchain`).
Expand Down
6 changes: 3 additions & 3 deletions tools/ecdsa_keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ typedef struct Message_Struct {

/* Private Data. */
/* All static data definitions appear here. */
uint32_t key[] =
const uint32_t key[] =
{ 0x78563412, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0xefcdac00 };

uint32_t iv[] =
const uint32_t iv[] =
{ 0x78563412, 0x00000000, 0x00000000, 0xefcdac00 };

/* Public Data. */
Expand Down Expand Up @@ -374,7 +374,7 @@ int main(int argc, char * argv[])
}
fclose(fd);

exit:
// exit:
BN_free(x);
BN_free(y);
EC_GROUP_free(ecgroup);
Expand Down

0 comments on commit 8fec8e5

Please sign in to comment.