Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use actions to cut down on repeated workflow code #27486

Merged
merged 20 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/bootstrap-cache/action.yaml
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/wretry.action@v1.3.0
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
8 changes: 8 additions & 0 deletions .github/actions/bootstrap/action.yaml
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 .github/actions/checkout-submodules-and-bootstrap/action.yaml
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 }}
16 changes: 16 additions & 0 deletions .github/actions/checkout-submodules/action.yaml
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 }}
38 changes: 38 additions & 0 deletions .github/actions/perform-codeql-analysis/action.yaml
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/upload-artifact@v2.2.0
with:
name: sarif-results
path: sarif-results
retention-days: 1
15 changes: 15 additions & 0 deletions .github/actions/setup-size-reports/action.yaml
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}"
18 changes: 18 additions & 0 deletions .github/actions/upload-bootstrap-logs/action.yaml
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
17 changes: 17 additions & 0 deletions .github/actions/upload-size-reports/action.yaml
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/
11 changes: 2 additions & 9 deletions .github/workflows/bloat_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,8 @@ jobs:
image: connectedhomeip/chip-build:0.7.3

steps:
- uses: Wandalen/wretry.action@v1.3.0
name: Checkout
with:
action: actions/checkout@v3.5.2
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000

- name: Checkout
uses: actions/checkout@v3
woody-apple marked this conversation as resolved.
Show resolved Hide resolved
- name: Report
run: |
scripts/tools/memory/gh_report.py \
Expand Down
Loading