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

Enable act tool for running CI jobs locally #9648

Merged
merged 3 commits into from
Sep 16, 2021

Conversation

electrocucaracha
Copy link
Collaborator

Problem

act tool allows to execute GitHub actions locally. Actions like upload-artifact and cache use third-party services configured defined through ACTIONS_RUNTIME_URL, ACTIONS_RUNTIME_TOKEN and ACTIONS_CACHE_URL environment variables, this dependency limits the execution of act tool.

Change overview

This change allows the execution of act tool locally for development and validation of GitHub jobs.

It also upgrade the upload-artifact GH action version to v2.

Testing

To run this locally it's necessary to install act and its dependencies described here. Once it's installed, CI jobs can be tested executing the following command:

$ act

The previous command will execute all jobs currently defined, resulting in downloading ~55 GB and consuming + 210 GB in HDD (/var/lib/docker) therefore, it's highly recommended to select the jobs to test.

$ act --list
ID                      Stage  Name                                          
android                 0      Build Android                                 
build_darwin            0      Build on Darwin (clang, python_lib)           
build_linux_gcc_debug   0      Build on Linux (gcc_debug)                    
build_linux             0      Build on Linux (gcc_release, clang, mbedtls)  
build_linux_python_lib  0      Build on Linux (python_lib)                   
cirque                  0      Cirque                                        
darwin                  0      Build Darwin                                  
doxygen                 0      Build Doxygen                                 
efr32                   0      EFR32                                         
esp32                   0      ESP32                                         
infineon                0      Infineon examples building                    
k32w                    0      K32W                                          
linux_standalone        0      Linux Standalone                              
mbedos                  0      Mbed OS examples building                     
nrfconnect              0      nRF Connect SDK                               
qpg                     0      QPG                                           
telink                  0      Telink                                        
tizen                   0      Tizen                                         
qemu                    0      ESP32                                         
test_suites_darwin      0      Test Suites - Darwin                          
test_suites_linux       0      Test Suites - Linux                           
unit_tests              0      Unit / Interation Tests                       
zap_templates           0      ZAP templates generation                   
$ act --job nrfconnect
[Build example - nRF Connect SDK/nRF Connect SDK] 🚀  Start image=connectedhomeip/chip-build-nrf-platform:latest
[Build example - nRF Connect SDK/nRF Connect SDK]   🐳  docker run image=connectedhomeip/chip-build-nrf-platform:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Build example - nRF Connect SDK/nRF Connect SDK]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
...

Upload GH action requires a server to store objects, this a well-known
limitation for the usage of act tool. This change makes disable the
Upload GH action when act tool is performing locally.

Signed-off-by: Victor Morales <[email protected]>
This change upgrades some GH actions that were using an older version
of upload-artifact GH action.

Signed-off-by: Victor Morales <[email protected]>
This change adds a condition to disable the haya14busa/action-cond
action of nrfconnect job during the execution of act tool.

Signed-off-by: Victor Morales <[email protected]>
@github-actions
Copy link

Size increase report for "esp32-example-build" from c23f6f4

File Section File VM
chip-bridge-app.elf .flash.text 72 72
chip-ipv6only-app.elf .flash.text 172 172
chip-shell.elf .flash.text 56 56
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-bridge-app.elf and ./pull_artifact/chip-bridge-app.elf:

sections,vmsize,filesize
.flash.text,72,72
[Unmapped],0,-72

Comparing ./master_artifact/chip-ipv6only-app.elf and ./pull_artifact/chip-ipv6only-app.elf:

sections,vmsize,filesize
[Unmapped],0,3924
.flash.text,172,172

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.flash.text,56,56
[Unmapped],0,-56

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize


@woody-apple
Copy link
Contributor

This is awesome, thank you!

@msandstedt @saurabhst ?

@woody-apple woody-apple merged commit 89d5353 into project-chip:master Sep 16, 2021
@electrocucaracha electrocucaracha deleted the enable-act branch September 16, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants