Skip to content

Commit

Permalink
[nrfconnect] Better filter which application to build on each PR (#15791
Browse files Browse the repository at this point in the history
)

* Revert "CI split between master (full) and PR (smoke) for NRF (#15606)"

This reverts commit fd915e5.

* [nrfconnect] Filter nRF workflow steps by changed paths

On a pull request, verify just all-clusters-app with the DFU
and add other steps only if specific paths like "nrfconnect",
"Zephyr" or "tests" have been modified.
  • Loading branch information
Damian-Nordic authored Mar 3, 2022
1 parent 4ab9f60 commit cb986fe
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ name: Build example - nRF Connect SDK

on:
push:
workflow_dispatch:
pull_request:

concurrency:
group: full-${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
cancel-in-progress: true

jobs:
nrfconnect:
name: nRF Connect SDK
timeout-minutes: 120

env:
BUILD_TYPE: nrfconnect

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

Expand All @@ -39,13 +43,26 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true

- name: Detect changed paths
uses: dorny/paths-filter@v2
id: changed_paths
with:
filters: |
nrfconnect:
- '**/nrfconnect/**'
- '**/Zephyr/**'
- '**/zephyr/**'
tests:
- '**/tests/**'
shell:
- 'examples/shell/nrfconnect/**'
pigweed-app:
- 'examples/pigweed-app/nrfconnect/**'
- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"

- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand All @@ -61,6 +78,7 @@ jobs:
timeout-minutes: 10
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --update --shallow"
- name: Build example nRF Connect SDK Lock App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh lock-app nrf52840dk_nrf52840
Expand All @@ -69,6 +87,7 @@ jobs:
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840
Expand All @@ -77,6 +96,7 @@ jobs:
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
Expand All @@ -85,6 +105,7 @@ jobs:
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 DK with RPC
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840 -DOVERLAY_CONFIG=rpc.overlay
Expand All @@ -93,6 +114,7 @@ jobs:
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Shell on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh shell nrf52840dk_nrf52840
Expand All @@ -101,6 +123,7 @@ jobs:
examples/shell/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Pigweed on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.pigweed-app == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh pigweed-app nrf52840dk_nrf52840
Expand All @@ -109,6 +132,7 @@ jobs:
examples/pigweed-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lock App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp
Expand All @@ -117,6 +141,7 @@ jobs:
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp
Expand All @@ -125,6 +150,7 @@ jobs:
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Pump App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh pump-app nrf52840dk_nrf52840
Expand All @@ -133,6 +159,7 @@ jobs:
examples/pump-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Pump Controller App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh pump-controller-app nrf52840dk_nrf52840
Expand All @@ -143,12 +170,13 @@ jobs:
- name: Build example nRF Connect SDK All Clusters App on nRF52840 DK
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840
scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840 -DBUILD_WITH_DFU=1
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dk_nrf52840 all-clusters-app \
examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Run unit tests for Zephyr native_posix_64 platform
if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true'
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build"
Expand Down
77 changes: 0 additions & 77 deletions .github/workflows/smoketest-nrfconnect.yaml

This file was deleted.

0 comments on commit cb986fe

Please sign in to comment.