add workflow #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dispatch Listener | |
on: | |
push: | |
paths-ignore: | |
- '**/README.md' | |
- '.*' | |
branches-ignore: | |
- 'gh-pages' | |
workflow_dispatch: | |
jobs: | |
# ------------------------ | |
prepare: | |
runs-on: ubuntu-latest | |
container: | |
image: hardwario/nrf-connect-sdk-build:v2.5.0-1 | |
outputs: | |
short_sha: ${{ steps.short-sha.outputs.short-sha }} | |
samples: ${{ steps.generate-matrix.outputs.samples }} | |
applications: ${{ steps.generate-matrix.outputs.applications }} | |
cache_chester_sdk_hit: ${{ steps.cache-chester-sdk.outputs.cache-hit }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
path: 'chester-sdk/chester' | |
- name: cache | |
id: cache-chester-sdk | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-chester-sdk | |
with: | |
key: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }} | |
restore-keys: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }} | |
path: | | |
chester-sdk/.west | |
chester-sdk/bootloader | |
chester-sdk/doxygen-awesome-css | |
chester-sdk/modules | |
chester-sdk/nrf | |
chester-sdk/nrfxlib | |
chester-sdk/test | |
chester-sdk/tools | |
chester-sdk/zephyr | |
- name: west init and update | |
if: steps.cache-chester-sdk.outputs.cache-hit != 'true' | |
run: | | |
cd chester-sdk | |
west init -l --mf west.yml chester | |
west update | |
west config build.board chester_nrf52840 | |
- name: short_sha | |
id: short-sha | |
run: | | |
SHORT_SHA=$(git -C chester-sdk/chester rev-parse --short HEAD) | |
echo ::set-output name=short-sha::${SHORT_SHA} | |
- name: Generate Matrix | |
id: generate-matrix | |
run: | | |
apt update | |
apt install -y jq | |
SAMPLES=$(ls chester-sdk/chester/samples | jq -R -s -c 'split("\n")[:-1]') | |
echo ::set-output name=samples::${SAMPLES} | |
APPLICATIONS=$(ls chester-sdk/chester/applications | jq -R -s -c 'split("\n")[:-1]') | |
echo ::set-output name=applications::${APPLICATIONS} | |
# ------------------------ | |
build-sample: | |
runs-on: ubuntu-latest | |
container: | |
image: hardwario/nrf-connect-sdk-build:v2.5.0-1 | |
needs: | |
- prepare | |
continue-on-error: true | |
strategy: | |
max-parallel: 10 | |
matrix: | |
sample: ${{ fromJSON(needs.prepare.outputs.samples) }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
path: 'chester-sdk/chester' | |
- name: restore cache with chester-sdk | |
id: cache-chester-sdk | |
uses: actions/cache/restore@v4 | |
env: | |
cache-name: cache-chester-sdk | |
with: | |
fail-on-cache-miss: true | |
key: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }} | |
path: | | |
chester-sdk/.west | |
chester-sdk/bootloader | |
chester-sdk/doxygen-awesome-css | |
chester-sdk/modules | |
chester-sdk/nrf | |
chester-sdk/nrfxlib | |
chester-sdk/test | |
chester-sdk/tools | |
chester-sdk/zephyr | |
- name: build | |
run: | | |
cd chester-sdk/chester/samples/${{ matrix.sample }} | |
west build | |
# ------------------------ | |
build-application: | |
runs-on: ubuntu-latest | |
container: | |
image: hardwario/nrf-connect-sdk-build:v2.5.0-1 | |
needs: | |
- prepare | |
continue-on-error: true | |
strategy: | |
matrix: | |
application: ${{ fromJSON(needs.prepare.outputs.applications) }} | |
exclude: | |
- application: _legacy | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
path: 'chester-sdk/chester' | |
- name: restore cache with chester-sdk | |
id: cache-chester-sdk | |
uses: actions/cache/restore@v4 | |
env: | |
cache-name: cache-chester-sdk | |
with: | |
fail-on-cache-miss: true | |
key: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }} | |
path: | | |
chester-sdk/.west | |
chester-sdk/bootloader | |
chester-sdk/doxygen-awesome-css | |
chester-sdk/modules | |
chester-sdk/nrf | |
chester-sdk/nrfxlib | |
chester-sdk/test | |
chester-sdk/tools | |
chester-sdk/zephyr | |
- name: build | |
run: | | |
cd chester-sdk/chester/applications/${{ matrix.application }} | |
west build | |
# ------------------------ | |
# debug-echo: | |
# runs-on: ubuntu-latest | |
# needs: | |
# - prepare | |
# steps: | |
# - name: Echo previous outputs | |
# run: echo "${{ toJSON(needs.prepare.outputs) }}" |