From cb61d422b65ca590a730e63791bb998e2bf6e379 Mon Sep 17 00:00:00 2001 From: Noah Pendleton <2538614+noahp@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:41:20 -0400 Subject: [PATCH] initial commit --- .github/workflows/main.c | 11 ++++++++ .github/workflows/test.elf | Bin 0 -> 5940 bytes .github/workflows/test_action.yml | 28 +++++++++++++++++++ README.md | 20 ++++++++++++++ action.yml | 43 ++++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+) create mode 100644 .github/workflows/main.c create mode 100755 .github/workflows/test.elf create mode 100644 .github/workflows/test_action.yml create mode 100644 README.md create mode 100644 action.yml diff --git a/.github/workflows/main.c b/.github/workflows/main.c new file mode 100644 index 0000000..a489b6f --- /dev/null +++ b/.github/workflows/main.c @@ -0,0 +1,11 @@ +// Stub main to generate a tiny, valid symbol file for testing upload. +// To generate the symbol file, run: +// +// arm-none-eabi-gcc -Os -g1 -mcpu=cortex-m4 -ffreestanding -nostdlib -Wl,--entry=main main.c -o test.elf +// +// NOTE: the above command uses "-g1" to omit macros from the .debug_str +// sections. "-g3" is always preferred for real world use cases. + +int main() { + return 0; +} diff --git a/.github/workflows/test.elf b/.github/workflows/test.elf new file mode 100755 index 0000000000000000000000000000000000000000..23fb9c18e2f59af85ebd00922eb956c03ad92e58 GIT binary patch literal 5940 zcmeHL&u`;I6n_~) zZb3-o&Sg(r;159J%8e6$1^)v#&LAz{8+(c|aNx$lPa4nnz4zwL%;$-v%$KL{z9WPn zZ3gWSGqE7rL;u4D9tJh{$bx@|R_PfP2OvTYw+1?HO*G}_zP4I{T7g=DT7g=DT7g=D zT7g=DT7g=DT7g=DT7mzM0@m#8?BwLWwR81>99&pu?>)4Rlh8U1J%2d#hZcg?)$9B2 z{@yEA|DLn!^sU|A?!A7mcSv`z4MS~(|Ng@k`9*-jc)W(zB%y+03FJABWN6C_3NvB= z(Q4|^;#(4H;%?_=+w9!#JltFptDBg|p|`fp&i(cq?Zft(SZ}?(_4zgi@*JirY>3}F zD}>7ob$@}96v`lS25Oq-GBpjJVY4YV3cS(s<3qaF*nxe^A}M zWru^={Ads-nSW)6d*GvKEHhhr!BHBIGB~oyJoM1ZWH33BNqBkS+o5HT`96mU;&#AStbbiBFZ)}KX#iqF>w#6;+ zeB(uy@b9+BU1oj*M2*Lq7l+`Qn|~Q=77Ni%GruX)6tAy!jTx9&a@kCJs!S2TQQ=Ql zc)P-vixubY2L1X(Rb1#aLAL<)epZpq70R5CTAAOi@IE--nX%;S7{6bMzggj@75)I6 zihZtPhaXnr`Y^tnk?VSC>f+cWnd=tJkA~M+Me@_+x<$Yr%1jb7;*o<3jAK_`hRDHD z%A|)rOY(lA5l(kT&dg8JAkF*;IEsTPKtG7XP&tOaHy^t)k6UOxpbEuviDW2A z#vJ7+hlx{q!&OSnP7%@0Imw{T4-D4?WwRHKHGLsGeMd z+gC-eoOt|l)QXbdLzdU(xYn|vZoE=d90P^~ [!TIP] +> +> The `MEMFAULT_ORG_TOKEN`, `MEMFAULT_ORG_SLUG`, and `MEMFAULT_PROJECT_SLUG` +> should be set as GitHub secrets. + +| Name | Description | Required | Default | +| ----------------------- | -------------------------------------------------------------------------------------------------------------- | -------- | ------- | +| `MEMFAULT_ORG_TOKEN` | Organization Auth Token. Generate one [here](https://app.memfault.com/organizations/-/settings/auth-tokens) | true | | +| `MEMFAULT_ORG_SLUG` | Memfault Org Slug | true | | +| `MEMFAULT_PROJECT_SLUG` | Memfault Project Slug | true | | +| `symbol_file` | Path to the symbol file | true | | +| `memfault_cli_version` | Memfault CLI Version | true | 1.0.11 | + +Find more documentation here: [Memfault Docs](https://docs.memfault.com/docs/ci/uploading-symbols). diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..a4a0c76 --- /dev/null +++ b/action.yml @@ -0,0 +1,43 @@ +name: 'Memfault Upload Symbol Files Action' + +description: 'Upload symbol files to Memfault' + +inputs: + MEMFAULT_ORG_TOKEN: + description: 'Organization Auth Token. Generate one at https://app.memfault.com/organizations/-/settings/auth-tokens' + required: true + MEMFAULT_ORG_SLUG: + description: 'Memfault Org Slug' + required: true + MEMFAULT_PROJECT_SLUG: + description: 'Memfault Project Slug' + required: true + + symbol_file: + description: 'Path to the symbol file' + required: true + memfault_cli_version: + description: 'Memfault CLI Version' + required: true + default: "1.0.11" + +runs: + using: 'composite' + steps: + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install Dependencies + shell: bash + run: pip install memfault-cli==${{ inputs.memfault_cli_version }} + + - name: Upload the symbol file + shell: bash + run: | + memfault \ + --org-token ${{ inputs.MEMFAULT_ORG_TOKEN }} \ + --org ${{ inputs.MEMFAULT_ORG_SLUG }} \ + --project ${{ inputs.MEMFAULT_PROJECT_SLUG }} \ + upload-mcu-symbols ${{ inputs.symbol_file }}