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

Make bloat check work with github actions #1441

Merged
merged 57 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
11f6be2
Initial commit to kick an actual build. Does not do much, but it does…
andy31415 Jul 3, 2020
4e6cbe5
Starting to remove ci artifact fetch and to see if we can make github…
andy31415 Jul 3, 2020
c83cccb
Starting to parse and log refs to get pr numbers
andy31415 Jul 3, 2020
fd74808
Fix argument format
andy31415 Jul 3, 2020
d72a377
Parse ref to get PR number
andy31415 Jul 3, 2020
f534a36
Log what exact argument is missing from a run
andy31415 Jul 3, 2020
882d53c
Fix up job name and command line argument descriptions
andy31415 Jul 3, 2020
307e13d
Attempt to use github token from workflow secrets
andy31415 Jul 3, 2020
34fa581
Pass in required tokens and add debug output
andy31415 Jul 3, 2020
65217b9
Start with a github fetch api
andy31415 Jul 3, 2020
cd61dfa
Can now list master commit
andy31415 Jul 3, 2020
a1fae56
Added ability to fetch artifacts ... we have a LOT of artifacts right…
andy31415 Jul 3, 2020
e1faea7
When uploading artifacts, use the sha as suffix to make artifacts uni…
andy31415 Jul 3, 2020
fadc7d5
Use contexts instead of environment variables
andy31415 Jul 3, 2020
24e570f
Add debug for merge master info
andy31415 Jul 3, 2020
d0d245a
Remove useless pass
andy31415 Jul 3, 2020
6cc3357
Start using a new docker image, which has a more recent git build
andy31415 Jul 3, 2020
3272ee8
Revert build.yaml for now, apparently this is checked for. Awkward th…
andy31415 Jul 3, 2020
538fd24
Try again to add workflow changes. I believe restyler is confused
andy31415 Jul 3, 2020
3f46aaa
Fix pattern for workflow changes (I hope)
andy31415 Jul 3, 2020
2d3ecca
Kill YAML restyler - only restricted files have yaml (like github wor…
andy31415 Jul 3, 2020
f126c81
Add final whitespace to build.yaml
andy31415 Jul 3, 2020
f6b63c6
reverted restyled.yaml. Something else is amiss and do not know what
andy31415 Jul 3, 2020
c846fff
Added final newline to all workflow yaml files
andy31415 Jul 3, 2020
17b1df9
Autoformatted build.yaml
andy31415 Jul 3, 2020
d0dd183
Revert build yaml format - this did not fix the restyler issue
andy31415 Jul 3, 2020
63bb2e6
Debug: figure out what branches exist in github workflows
andy31415 Jul 3, 2020
d345306
Pass in the github head ref
andy31415 Jul 3, 2020
c83cbf1
Correct the ref: use base ref
andy31415 Jul 3, 2020
c42ee39
Use the 2.17 image for nrf and standalone as well
andy31415 Jul 3, 2020
fbe9308
Get a commit SHA from any rev compares
andy31415 Jul 3, 2020
5889170
Merge branch 'master' into 01_bloat_in_github
andy31415 Jul 3, 2020
ebbca0f
More attempts for debug
andy31415 Jul 6, 2020
2fa7efd
Another debug attempt: tmate fails because no sudo
andy31415 Jul 6, 2020
ad210bf
Debug NRF: compiling esp is WAAAY to sllow
andy31415 Jul 6, 2020
bf9d2c6
back to esp32 debug: need ngrok before build, since ngrok seems to ru…
andy31415 Jul 6, 2020
419c410
More debug - ssh fails completely, resorting to command line
andy31415 Jul 6, 2020
4a0f201
Add fetch depth to checkout
andy31415 Jul 6, 2020
72cf0f4
checkout all history
andy31415 Jul 6, 2020
8808e58
Check if remotes master mergepoint works
andy31415 Jul 6, 2020
b5d511e
Log entire history, to check what the master rev looks like
andy31415 Jul 6, 2020
9fcdc4b
Update the script to use a command line fork point
andy31415 Jul 6, 2020
f046673
Add depth 0 checkout for all items, remove debug output
andy31415 Jul 6, 2020
ceca22c
Bloat report script seems to run
andy31415 Jul 6, 2020
5ca72c4
Enable bloat report for nrf and linux as well
andy31415 Jul 6, 2020
6f11374
Fix syntax for multiline run
andy31415 Jul 6, 2020
560772a
another multiline fix
andy31415 Jul 6, 2020
df8e7e7
Fix output dir creation name for linux
andy31415 Jul 6, 2020
5de4372
Put a try/catch around PR comments: this fails until we update our AP…
andy31415 Jul 6, 2020
78d40a6
Update token used for bloat reports
andy31415 Jul 6, 2020
1e56b74
Merge branch 'master' into 01_bloat_in_github
andy31415 Jul 6, 2020
2427b33
Pass api key via env
andy31415 Jul 6, 2020
7602666
Use the restricted token for now
andy31415 Jul 6, 2020
4351126
Merge branch 'master' into 01_bloat_in_github
andy31415 Jul 9, 2020
009553c
Bring back examples repos to make code compile
andy31415 Jul 9, 2020
115ca34
Undo changes to dockerfile and vscode
andy31415 Jul 9, 2020
59daba0
add back m5stack-tft submodule
andy31415 Jul 9, 2020
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
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