Skip to content

Commit 3ef6d93

Browse files
Merge branch 'main' into automation/update_main
2 parents 0a21983 + aa36c94 commit 3ef6d93

21 files changed

+1997
-0
lines changed

.github/CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Default codeowners for the repository
2+
* @SiliconLabsSoftware/matter-watt-reviewers
3+
4+
#codeowners for the CODEOWNERS file
5+
/.github/CODEOWNERS @SiliconLabsSoftware/matter-admin

.github/silabs-builds-mg24.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"default": [
3+
{
4+
"boards": ["BRD4186C", "BRD4187C", "BRD2601B", "BRD2703A"],
5+
"arguments": ["--docker"]
6+
},
7+
{
8+
"boards": ["BRD4187C"],
9+
"arguments": ["--docker", "--wifi wf200"]
10+
},
11+
{
12+
"boards": ["BRD4187C"],
13+
"arguments": ["--docker", "--wifi rs9116"]
14+
},
15+
{
16+
"boards": ["BRD4187C"],
17+
"arguments": ["--docker", "--wifi SiWx917"]
18+
}
19+
]
20+
}

.github/silabs-builds-mg26.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"default": [
3+
{
4+
"boards": ["BRD4116A", "BRD4117A", "BRD4118A", "BRD2608A"],
5+
"arguments": ["--docker"]
6+
}
7+
]
8+
}

.github/silabs-builds-mgm24.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"default": [
3+
{
4+
"boards": ["BRD4316A", "BRD4317A", "BRD4318A", "BRD4319A", "BRD2704A"],
5+
"arguments": ["--docker"]
6+
}
7+
]
8+
}

.github/silabs-builds-siwx.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"default": [
3+
{
4+
"boards": ["BRD4338A", "BRD2605A", "BRD4343A", "BRD4342A"],
5+
"arguments": ["--docker", "use_rps_extension=false"]
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build Silabs Examples apps
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "release_*"
8+
pull_request:
9+
branches:
10+
- main
11+
- "release_*"
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: silabs-build-examples-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build-lighting-app:
20+
name: Build Lighting-App variations
21+
uses: ./.github/workflows/silabs-common-build.yaml
22+
with:
23+
example-app: "lighting-app"
24+
output-directory: "./out/lighting-app"
25+
26+
build-air-quality-sensor-app:
27+
name: Build Air-Quality-Sensor-App variations
28+
uses: ./.github/workflows/silabs-common-build.yaml
29+
with:
30+
example-app: "air-quality-sensor-app"
31+
output-directory: "./out/air-quality-sensor-app"
32+
33+
build-dishwasher-app:
34+
name: Build Dishwasher-App variations
35+
uses: ./.github/workflows/silabs-common-build.yaml
36+
with:
37+
example-app: "dishwasher-app"
38+
output-directory: "./out/dishwasher-app"
39+
40+
build-light-switch-app:
41+
name: Build Light-Switch-App variations
42+
uses: ./.github/workflows/silabs-common-build.yaml
43+
with:
44+
example-app: "light-switch-app"
45+
output-directory: "./out/light-switch-app"
46+
47+
build-lock-app:
48+
name: Build Lock-App variations
49+
uses: ./.github/workflows/silabs-common-build.yaml
50+
with:
51+
example-app: "lock-app"
52+
output-directory: "./out/lock-app"
53+
54+
build-thermostat:
55+
name: Build Thermostat variations
56+
uses: ./.github/workflows/silabs-common-build.yaml
57+
with:
58+
example-app: "thermostat"
59+
output-directory: "./out/thermostat"
60+
61+
build-pump-app:
62+
name: Build Pump-App variations
63+
uses: ./.github/workflows/silabs-common-build.yaml
64+
with:
65+
example-app: "pump-app"
66+
output-directory: "./out/pump-app"
67+
68+
build-window-app:
69+
name: Build Window-App variations
70+
uses: ./.github/workflows/silabs-common-build.yaml
71+
with:
72+
example-app: "window-app"
73+
output-directory: "./out/window-app"
74+
75+
build-smoke-co-alarm:
76+
name: Build Smoke-CO-Alarm variations
77+
uses: ./.github/workflows/silabs-common-build.yaml
78+
with:
79+
example-app: "smoke-co-alarm-app"
80+
output-directory: "./out/smoke-co-alarm-app"
81+
82+
build-lit-icd-app:
83+
name: Build Lit-ICD-App variations
84+
uses: ./.github/workflows/silabs-common-build.yaml
85+
with:
86+
example-app: "lit-icd-app"
87+
output-directory: "./out/lit-icd-app"
88+
89+
build-refrigerator-app:
90+
name: Build Refrigerator-App variations
91+
uses: ./.github/workflows/silabs-common-build.yaml
92+
with:
93+
example-app: "refrigerator-app"
94+
output-directory: "./out/refrigerator-app"
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Common Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
example-app:
7+
required: true
8+
type: string
9+
output-directory:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
container:
18+
image: ghcr.io/project-chip/chip-build-efr32:95
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
platform: [mg24, mgm24, mg26, siwx]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Checkout submodules & Bootstrap
30+
uses: ./.github/actions/checkout-submodules-and-bootstrap
31+
with:
32+
platform: silabs_docker
33+
bootstrap-log-name: bootstrap-logs-${{ inputs.example-app }}-${{ matrix.platform }}
34+
35+
- name: Build ${{ inputs.example-app }} configurations
36+
uses: SiliconLabsSoftware/matter-gn-build-action@v1.1.2
37+
with:
38+
json-file-path: >
39+
${{ matrix.platform == 'mg24' && './.github/silabs-builds-mg24.json' ||
40+
matrix.platform == 'mgm24' && './.github/silabs-builds-mgm24.json' ||
41+
matrix.platform == 'mg26' && './.github/silabs-builds-mg26.json' ||
42+
matrix.platform == 'siwx' && './.github/silabs-builds-siwx.json' }}
43+
example-app: ${{ inputs.example-app }}
44+
build-script: "./scripts/examples/gn_silabs_example.sh"
45+
output-directory: ${{ inputs.output-directory }}
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Open PR from csa to main
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
7+
on:
8+
workflow_run:
9+
workflows: ["Daily Sync of the csa branch"]
10+
types:
11+
- completed
12+
workflow_dispatch:
13+
14+
jobs:
15+
open-pr:
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: main
22+
23+
- name: Checkout csa
24+
run: |
25+
git fetch origin csa:csa
26+
git reset --hard csa
27+
28+
- name: Create Pull Request
29+
uses: peter-evans/create-pull-request@v7
30+
with:
31+
branch: automation/update_main
32+
base: main
33+
title: "Sync csa branch with main"
34+
body: |
35+
This PR syncs the csa branch with the main branch.
36+
37+
**PR MUST BE MERGED WITH MERGE COMMIT - ADMIN MUST ENABLE THE OPTION**
38+
token: ${{secrets.GITHUB_TOKEN}}
39+
labels:
40+
changing-submodules-on-purpose, sl-require-admin-action
41+
42+
# The next step is necessary to force the CI to be executed when a PR is opened by the github-bot.
43+
# The PR event isn't triggered when the bot opens the PR and as such doesn't trigger the workflows that use the event as their trigger.
44+
# By closing and opening the PR, it forces the PR event to be triggered.
45+
- name: Check if PR is already closed and reopen if necessary
46+
run: |
47+
PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --state open --head automation/update_main --json number --jq '.[0].number')
48+
if [ -z "$PR_NUMBER" ]; then
49+
echo "PR not found."
50+
exit 1
51+
fi
52+
LABELS=$(gh pr view $PR_NUMBER --repo ${{ github.repository }} --json labels --jq '.labels[].name')
53+
if ! echo "$LABELS" | grep -q "sl-automation-triggered"; then
54+
gh pr close $PR_NUMBER --repo ${{ github.repository }}
55+
gh pr reopen $PR_NUMBER --repo ${{ github.repository }}
56+
fi
57+
env:
58+
GITHUB_TOKEN: ${{secrets.WORKFLOW_TOKEN}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Check for sl-require-admin-action label
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- release_*
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
- labeled
13+
- unlabeled
14+
15+
permissions:
16+
pull-requests: write
17+
18+
jobs:
19+
check-label:
20+
name: Fail CI if sl-require-admin-action label is present
21+
runs-on: ubuntu-latest
22+
if:
23+
${{ contains(github.event.pull_request.labels.*.name,
24+
'sl-require-admin-action') }}
25+
steps:
26+
- name: Add comment to PR
27+
uses: actions/github-script@v7
28+
with:
29+
script: |
30+
const prNumber = context.payload.pull_request.number;
31+
const comment = "The check for `sl-require-admin-action` label CI failure for this job is normal. An admin must do the merge.";
32+
const { data: comments } = await github.rest.issues.listComments({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
issue_number: prNumber,
36+
});
37+
const existingComment = comments.find(c => c.body.includes(comment));
38+
if (!existingComment) {
39+
await github.rest.issues.createComment({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
issue_number: prNumber,
43+
body: comment,
44+
});
45+
}
46+
47+
- name: Trigger CI failure
48+
run: |
49+
echo "The sl-require-admin-action label is present. Failing the job."
50+
process.exit(1);
51+
env:
52+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
53+
54+
prevent-label-removal:
55+
name: Prevent sl-require-admin-action label from being removed
56+
runs-on: ubuntu-latest
57+
if:
58+
github.event.action == 'unlabeled' && github.event.label.name ==
59+
'sl-require-admin-action'
60+
steps:
61+
- name: Add comment to PR
62+
uses: actions/github-script@v7
63+
with:
64+
script: |
65+
const prNumber = context.payload.pull_request.number;
66+
const comment = "The `sl-require-admin-action` label cannot be removed once it has been added.";
67+
const { data: comments } = await github.rest.issues.listComments({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
issue_number: prNumber,
71+
});
72+
const existingComment = comments.find(c => c.body.includes(comment));
73+
if (!existingComment) {
74+
await github.rest.issues.createComment({
75+
owner: context.repo.owner,
76+
repo: context.repo.repo,
77+
issue_number: prNumber,
78+
body: comment,
79+
});
80+
}
81+
82+
- name: Re-add sl-require-admin-action label
83+
uses: actions/github-script@v7
84+
with:
85+
script: |
86+
const prNumber = context.payload.pull_request.number;
87+
await github.rest.issues.addLabels({
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
issue_number: prNumber,
91+
labels: ['sl-require-admin-action'],
92+
});
93+
94+
- name: Trigger CI failure
95+
run: |
96+
echo "The sl-require-admin-action label cannot be removed. Failing the job."
97+
process.exit(1);
98+
env:
99+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Daily Sync of the csa branch
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
schedule:
8+
- cron: "0 0 * * *" # Runs once a day at midnight
9+
workflow_dispatch: # Allows manual triggering of the workflow
10+
11+
jobs:
12+
sync:
13+
if: github.ref == 'refs/heads/main'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout matter_sdk::csa branch
18+
uses: actions/checkout@v2
19+
with:
20+
repository: SiliconLabsSoftware/matter_sdk
21+
ref: csa
22+
token: ${{ secrets.WORKFLOW_TOKEN }}
23+
24+
- name: Add CSA repository remote
25+
run:
26+
git remote add upstream
27+
https://github.com/project-chip/connectedhomeip.git
28+
29+
- name: Update the csa branch locally
30+
run: git pull upstream master
31+
32+
- name: Push the update csa branch to the remote
33+
run: |
34+
git push origin csa

0 commit comments

Comments
 (0)