Skip to content

Commit

Permalink
Make bloat check work with github actions (project-chip#1441)
Browse files Browse the repository at this point in the history
Also merges master build as a sideeffect
  • Loading branch information
andy31415 authored Jul 9, 2020
1 parent ace290d commit 67a1b59
Show file tree
Hide file tree
Showing 8 changed files with 277 additions and 200 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ jobs:
type: [main, clang, linux-embedded, mbedtls]
env:
BUILD_TYPE: ${{ matrix.type }}
BUILD_VERSION: 0.3.0
BUILD_IMAGE: chip-build
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: "connectedhomeip/chip-build:0.3.0"
image: connectedhomeip/chip-build:0.3.0
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down Expand Up @@ -78,3 +75,4 @@ jobs:
# - name: Upload Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: bash <(curl -s https://codecov.io/bash)

117 changes: 77 additions & 40 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,113 +10,150 @@ jobs:

env:
BUILD_TYPE: esp32
BUILD_VERSION: 0.3.0
BUILD_IMAGE: chip-build-esp32
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-esp32:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION
image: connectedhomeip/chip-build-esp32:0.3.0
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"

steps:
- name: Checkout
uses: actions/checkout@v2
# Fetch depth 0 to get all history and be able to check mergepoint for bloat report
with:
fetch-depth: 0
submodules: true
- name: Build example Echo App
run: scripts/examples/esp_echo_app.sh
- name: Copy aside build products
run:
mkdir -p example_binaries/$BUILD_TYPE-build; cp
examples/wifi-echo/server/esp32/build/chip-wifi-echo.elf example_binaries/$BUILD_TYPE-build/chip-wifi-echo.elf

# - name: Generate bloat report
# run: |
# mkdir -p "master_binaries/esp32-build"
# scripts/helpers/bloat_check.py \
# --token "$GITHUB_TOKEN" \
# --job "$GITHUB_WORKFLOW" \
# --artifact-download-dir "master_binaries/$BUILD_TYPE-build" \
# --build-output-dir "example_binaries/$BUILD_TYPE-build" \
# --report-file bloat_report.txt \
# --github-repository "$GITHUB_REPOSITORY" \
# --github-comment-pr-number "$CIRCLE_PR_NUMBER"
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/wifi-echo/server/esp32/build/chip-wifi-echo.elf \
example_binaries/$BUILD_TYPE-build/chip-wifi-echo.elf
- name: Generate bloat report
# job name MUST match prefix of artifact uploading (sans SHA)
run: |
mkdir -p "master_binaries/$BUILD_TYPE-build"
scripts/helpers/bloat_check.py \
--job "${{ env.BUILD_TYPE }}-example-build" \
--artifact-download-dir "master_binaries/$BUILD_TYPE-build" \
--build-output-dir "example_binaries/$BUILD_TYPE-build" \
--report-file bloat_report.txt \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--github-repository "${{ github.repository }}" \
--github-ref "${{ github.ref }}" \
--git-fork-poin "remotes/origin/${{ github.base_ref }}"
- name: Copy aside bloat report & binaries
run: |
cp -r example_binaries/$BUILD_TYPE-build /tmp/output_binaries/
# cp bloat_report.txt /tmp/bloat_reports/
# - name: Uploading Bloat Report
# uses: actions/upload-artifact@v1
# with:
# name: ${{ env.BUILD_TYPE }}-bloat-report
# path: /tmp/bloat_reports/bloat_report.txt
- name: Uploading Binaries
uses: actions/upload-artifact@v1
with:
name: ${{ env.BUILD_TYPE }}-example-build
name: ${{ env.BUILD_TYPE }}-example-build-${{ github.sha }}
path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build

nrf:
name: nRF

env:
BUILD_TYPE: nrf
BUILD_VERSION: 0.3.0
BUILD_IMAGE: chip-build-nrf-platform
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-nrf-platform:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION
image: connectedhomeip/chip-build-nrf-platform:0.3.0
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"

steps:
- name: Checkout
uses: actions/checkout@v2
# Fetch depth 0 to get all history and be able to check mergepoint for bloat report
with:
fetch-depth: 0
submodules: true
- name: Build example nRF5 Lock App
run: scripts/examples/nrf_lock_app.sh
- name: Preserve artifacts
run:
mkdir -p example_binaries/nrf-build ; cp
examples/lock-app/nrf5/build/chip-nrf52840-lock-example.out example_binaries/nrf-build/chip-nrf52840-lock-example.out
- name: Copy aside build products
run: |
mkdir -p example_binaries/nrf-build
cp examples/lock-app/nrf5/build/chip-nrf52840-lock-example.out \
example_binaries/$BUILD_TYPE-build/chip-nrf52840-lock-example.out
- name: Generate bloat report
# job name MUST match prefix of artifact uploading (sans SHA)
run: |
mkdir -p "master_binaries/$BUILD_TYPE-build"
scripts/helpers/bloat_check.py \
--job "${{ env.BUILD_TYPE }}-example-build" \
--artifact-download-dir "master_binaries/$BUILD_TYPE-build" \
--build-output-dir "example_binaries/$BUILD_TYPE-build" \
--report-file bloat_report.txt \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--github-repository "${{ github.repository }}" \
--github-ref "${{ github.ref }}" \
--git-fork-poin "remotes/origin/${{ github.base_ref }}"
- name: Copy aside bloat report & binaries
run: |
cp -r example_binaries/$BUILD_TYPE-build /tmp/output_binaries/
- name: Uploading Binaries
uses: actions/upload-artifact@v1
with:
name: ${{ env.BUILD_TYPE }}-example-build-${{ github.sha }}
path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build

linux-standalone:
name: Linux Standalone

env:
BUILD_TYPE: linux
BUILD_VERSION: 0.3.0
BUILD_IMAGE: chip-build
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION
image: connectedhomeip/chip-build:0.3.0
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"

steps:
- name: Checkout
uses: actions/checkout@v2
# Fetch depth 0 to get all history and be able to check mergepoint for bloat report
with:
fetch-depth: 0
submodules: true
- name: Build example Standalone Echo Client
run: scripts/examples/standalone_echo_client.sh
- name: Build example Standalone Shell
run: scripts/examples/standalone_shell.sh
- name: Preserve artifacts
run: |
mkdir -p example_binaries/$BUILD_TYPE
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/chip-tool/build/chip-standalone-demo.out \
example_binaries/$BUILD_TYPE/chip-standalone-demo.out
example_binaries/$BUILD_TYPE-build/chip-standalone-demo.out
- name: Generate bloat report
# job name MUST match prefix of artifact uploading (sans SHA)
run: |
mkdir -p "master_binaries/$BUILD_TYPE-build"
scripts/helpers/bloat_check.py \
--job "${{ env.BUILD_TYPE }}-example-build" \
--artifact-download-dir "master_binaries/$BUILD_TYPE-build" \
--build-output-dir "example_binaries/$BUILD_TYPE-build" \
--report-file bloat_report.txt \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--github-repository "${{ github.repository }}" \
--github-ref "${{ github.ref }}" \
--git-fork-poin "remotes/origin/${{ github.base_ref }}"
- name: Copy aside bloat report & binaries
run: |
cp -r example_binaries/$BUILD_TYPE-build /tmp/output_binaries/
- name: Uploading Binaries
uses: actions/upload-artifact@v1
with:
name: ${{ env.BUILD_TYPE }}-example-build-${{ github.sha }}
path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build

6 changes: 2 additions & 4 deletions .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ jobs:

env:
BUILD_TYPE: esp32-qemu
BUILD_VERSION: 0.3.0
BUILD_IMAGE: chip-build-esp32-qemu
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-esp32-qemu:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION
image: connectedhomeip/chip-build-esp32-qemu:0.3.0
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand All @@ -37,3 +34,4 @@ jobs:
with:
name: qemu-esp32-logs
path: /tmp/log_output

1 change: 1 addition & 0 deletions examples/common/QRCode/repo
Submodule repo added at 08ac80
1 change: 1 addition & 0 deletions examples/common/m5stack-tft/repo
Submodule repo added at 35be97
Loading

0 comments on commit 67a1b59

Please sign in to comment.