forked from project-chip/connectedhomeip
-
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.
Use actions to cut down on repeated workflow code (project-chip#27486)
* Testing this out * Moving to actions * Can't do this for checkout :( * Giving these names * Collapsing more * Moving this to the right place * Moving these to the new standard ones * Updating name * Adding CodeQL * Moving last straggler over * This retry isn't buying us anything anymore, this was a github infra issue * Cleaning this one up too * Typo on this one * Size reports * Workaround not needed anymore * This needs to be done in this order * Typo in this flow * Fixing lint file * adding recursive back
- Loading branch information
1 parent
642d6dd
commit 1548bae
Showing
49 changed files
with
541 additions
and
1,766 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,17 @@ | ||
name: Bootstrap cache | ||
description: Bootstrap cache | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: Wandalen/[email protected] | ||
name: Bootstrap cache | ||
continue-on-error: true | ||
with: | ||
action: buildjet/cache@v3 | ||
attempt_limit: 3 | ||
attempt_delay: 2000 | ||
with: | | ||
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} | ||
path: | | ||
.environment | ||
build_overrides/pigweed_environment.gni |
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,8 @@ | ||
name: Bootstrap | ||
description: Bootstrap | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Bootstrap | ||
shell: bash | ||
run: bash scripts/bootstrap.sh |
30 changes: 30 additions & 0 deletions
30
.github/actions/checkout-submodules-and-bootstrap/action.yaml
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,30 @@ | ||
name: Checkout submodules & Bootstrap | ||
description: Checkout submodules & Bootstrap | ||
inputs: | ||
platform: | ||
description: "Platform name" | ||
required: true | ||
extra-submodule-parameters: | ||
description: "extra submodule parameters" | ||
required: false | ||
default: "" | ||
bootstrap-log-name: | ||
description: "Bootstrap log name" | ||
required: false | ||
default: bootstrap-logs | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout submodules | ||
uses: ./.github/actions/checkout-submodules | ||
with: | ||
platform: ${{ inputs.platform }} | ||
extra-parameters: ${{ inputs.extra-submodule-parameters }} | ||
- name: Bootstrap Cache | ||
uses: ./.github/actions/bootstrap-cache | ||
- name: Bootstrap | ||
uses: ./.github/actions/bootstrap | ||
- name: Upload Bootstrap Logs | ||
uses: ./.github/actions/upload-bootstrap-logs | ||
with: | ||
platform: ${{ inputs.bootstrap-log-name }} |
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,16 @@ | ||
name: Checkout submodules | ||
description: Checkout submodules | ||
inputs: | ||
extra-parameters: | ||
description: "extra parameters" | ||
required: false | ||
default: "" | ||
platform: | ||
description: "Platform name" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout submodules | ||
shell: bash | ||
run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform ${{ inputs.platform }} ${{ inputs.extra-parameters }} |
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,38 @@ | ||
name: Run CodeQL Analysis | ||
description: Run and upload CodeQL Analysis | ||
inputs: | ||
language: | ||
description: "language for codeql analysis" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Perform CodeQL Analysis | ||
if: ${{ inputs.run-codeql }} | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{ inputs.language }}" | ||
upload: False | ||
output: sarif-results | ||
- name: filter-sarif | ||
if: ${{ inputs.run-codeql }} | ||
uses: advanced-security/filter-sarif@v1 | ||
with: | ||
patterns: | | ||
-**/third_party/** | ||
-**/scripts/** | ||
input: "sarif-results/${{ inputs.language }}.sarif" | ||
output: "sarif-results/${{ inputs.language }}.sarif" | ||
|
||
- name: Upload SARIF | ||
if: ${{ inputs.run-codeql }} | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: "sarif-results/${{ inputs.language }}.sarif" | ||
- name: Upload loc as a Build Artifact | ||
if: ${{ inputs.run-codeql }} | ||
uses: actions/[email protected] | ||
with: | ||
name: sarif-results | ||
path: sarif-results | ||
retention-days: 1 |
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,15 @@ | ||
name: Setup size reports | ||
description: Setup size reports | ||
inputs: | ||
gh-context: | ||
description: "GH Context" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up environment for size reports | ||
shell: bash | ||
env: | ||
GH_CONTEXT: ${{ inputs.gh-context }} | ||
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" |
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,18 @@ | ||
name: Upload bootstrap logs | ||
description: Upload bootstrap logs | ||
inputs: | ||
bootstrap-log-name: | ||
description: "Bootstrap log name" | ||
required: false | ||
default: bootstrap-logs | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Uploading bootstrap logs | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ always() && !env.ACT }} | ||
with: | ||
name: ${{ inputs.bootstrap-log-name }} | ||
path: | | ||
.environment/gn_out/.ninja_log | ||
.environment/pigweed-venv/*.log |
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,17 @@ | ||
name: upload-size-reports | ||
description: upload-size-reports | ||
inputs: | ||
platform-name: | ||
description: "Platform name Name" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Uploading Size Reports | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !env.ACT }} | ||
with: | ||
name: Size,${{ inputs.platform-name }}-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} | ||
path: | | ||
/tmp/bloat_reports/ |
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 |
---|---|---|
|
@@ -36,15 +36,8 @@ jobs: | |
image: connectedhomeip/chip-build:0.7.3 | ||
|
||
steps: | ||
- uses: Wandalen/[email protected] | ||
name: Checkout | ||
with: | ||
action: actions/[email protected] | ||
with: | | ||
token: ${{ github.token }} | ||
attempt_limit: 3 | ||
attempt_delay: 2000 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Report | ||
run: | | ||
scripts/tools/memory/gh_report.py \ | ||
|
Oops, something went wrong.