GitHub Action used to build Matter examples with the GN build system.
- Usage
- Inputs
- Outputs
- Example Workflow
- Setup and Testing
- Testing GitHub Actions Locally
- Default Builds
To use this action, include it in your workflow YAML file.
Name | Description |
---|---|
example-app |
Example app to build |
json-file-path |
JSON content to be used as GN args |
build-script |
Build script to be executed for the provided example app |
output-directory |
Output directory for the build artifacts |
This action does not produce any outputs.
name: Build Matter Example
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build Matter Example
uses: ./ # Uses an action in the root directory
with:
example-app: "lighting-app"
json-file-path: "./path/to/json.json"
build-script: "./path/to/build_script.sh"
output-directory: "./path/to/output"
- name: Upload Build Artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: out/examples/lighting-app
To set up the repository and run the unit tests, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/matter-gn-build-action.git
cd matter-gn-build-action
- Install dependencies:
npm install
Run the tests:
npm test
You can use the act
tool to test GitHub Actions locally.
- Install
act
:
brew install act
- Run the action locally:
act --container-architecture linux/amd64 -W .github/workflows/eslint-check.yml
If the JSON file contains a "default" key, the action will also run the build commands specified under this key. This allows you to define common build configurations that should be executed regardless of the specific example app.
Example JSON structure:
{
"default": [
{
"boards": ["defaultBoard"],
"arguments": ["defaultArg1", "defaultArg2"]
}
],
"exampleApp": [
{
"boards": ["board1"],
"arguments": ["arg1", "arg2"]
}
]
}