-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cb61d42
Showing
5 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Test Action | ||
# Run on PRs targeting main, and push to main | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
# also support on workflow_dispatch | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-action: | ||
runs-on: ubuntu-latest | ||
name: Run a test of the action | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test action | ||
id: test_action | ||
uses: ./ # Uses an action in the root directory | ||
with: | ||
MEMFAULT_ORG_TOKEN: ${{ secrets.MEMFAULT_ORG_TOKEN }} | ||
MEMFAULT_ORG_SLUG: ${{ secrets.MEMFAULT_ORG_SLUG }} | ||
MEMFAULT_PROJECT_SLUG: ${{ secrets.MEMFAULT_PROJECT_SLUG }} | ||
symbol_file: ./github/workflows/test.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Memfault Upload Symbol File GitHub Action | ||
|
||
This action uploads a symbol file to Memfault's symbol file service. | ||
|
||
## Inputs | ||
|
||
> [!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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |