Refactor github actions into parallel jobs

This commit is contained in:
rbaron 2023-03-19 16:26:12 +01:00
parent bf9f4e1b5b
commit ead6fd434d

View file

@ -7,10 +7,11 @@ on:
pull_request: pull_request:
branches: branches:
- main - main
jobs: jobs:
build: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Check format & build samples name: Check code format
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -19,81 +20,77 @@ jobs:
with: with:
check-path: 'code/nrf-connect' check-path: 'code/nrf-connect'
exclude-regex: '\/build\/' exclude-regex: '\/build\/'
build-blinky:
runs-on: ubuntu-latest
name: Build blinky sample
needs:
- lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build blinky - name: Build blinky
uses: ./.github/actions/build uses: ./.github/actions/build
with: with:
sample-dir: code/nrf-connect/samples/blinky sample-dir: code/nrf-connect/samples/blinky
board: bparasite_nrf52840 board: bparasite_nrf52840
revision: 2.0.0
output-bin: blinky_nrf52840.hex output-bin: blinky_nrf52840.hex
build-soil-read-loop:
runs-on: ubuntu-latest
name: Build soil_read_loop sample
needs:
- lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build soil_read_loop - name: Build soil_read_loop
uses: ./.github/actions/build uses: ./.github/actions/build
with: with:
sample-dir: code/nrf-connect/samples/soil_read_loop sample-dir: code/nrf-connect/samples/soil_read_loop
board: bparasite_nrf52840 board: bparasite_nrf52840
revision: 2.0.0
output-bin: soil_read_loop_nrf52840.hex output-bin: soil_read_loop_nrf52840.hex
- name: Build ble_nrf52840_1_2_0_default.hex
build-ble:
strategy:
matrix:
soc: [nrf52840, nrf52833]
revision: [1.1.0, 1.2.0, 2.0.0]
runs-on: ubuntu-latest
name: Build ble sample for ${{ matrix.soc }}@${{ matrix.revision }}
needs:
- lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
uses: ./.github/actions/build_and_upload uses: ./.github/actions/build_and_upload
with: with:
sample-dir: code/nrf-connect/samples/ble sample-dir: code/nrf-connect/samples/ble
board: bparasite_nrf52840 board: bparasite_${{ matrix.soc }}
revision: '1.2.0' revision: ${{ matrix.revision }}
output-bin: ble_nrf52840_1_2_0_default.hex cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_SEC=1 -DCONFIG_PRSTLIB_LOG_LEVEL_DEBUG=y
- name: Build ble_nrf52840_1_1_0_default.hex output-bin: ble_${{ matrix.soc }}_${{ matrix.version }}_debug.hex
uses: ./.github/actions/build_and_upload
with: build-zigbee:
sample-dir: code/nrf-connect/samples/ble strategy:
board: bparasite_nrf52840 matrix:
revision: '1.1.0' soc: [nrf52840, nrf52833]
output-bin: ble_nrf52840_1_1_0_default.hex revision: [1.2.0, 2.0.0]
- name: Build ble_nrf52840_1_0_0_default.hex runs-on: ubuntu-latest
uses: ./.github/actions/build_and_upload name: Build zigbee sample for ${{ matrix.soc }}@${{ matrix.revision }}
with: needs:
sample-dir: code/nrf-connect/samples/ble - lint
board: bparasite_nrf52840 steps:
revision: '1.0.0' - name: Checkout
output-bin: ble_nrf52840_1_0_0_default.hex uses: actions/checkout@v3
- name: Build ble_test_nrf52840_bthomev1_1s.hex - name: Build
uses: ./.github/actions/build_and_upload
with:
sample-dir: code/nrf-connect/samples/ble
board: bparasite_nrf52840
revision: '1.2.0'
cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V1=y -DCONFIG_PRST_SLEEP_DURATION_SEC=1
output-bin: ble_test_nrf52840_bthomev1_1s.hex
- name: Build ble_test_nrf52840_bthomev2_1s.hex
uses: ./.github/actions/build_and_upload
with:
sample-dir: code/nrf-connect/samples/ble
board: bparasite_nrf52840
revision: '1.2.0'
cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_SEC=1
output-bin: ble_test_nrf52840_bthomev2_1s.hex
- name: Build ble_test_nrf52840_bthomev2_1s_v2.0.0.hex
uses: ./.github/actions/build_and_upload
with:
sample-dir: code/nrf-connect/samples/ble
board: bparasite_nrf52840
revision: '2.0.0'
cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_SEC=1
output-bin: ble_test_nrf52840_bthomev2_1s_v2.0.0.hex
- name: Build ble_test_nrf52833_bthomev2_1s_v2.0.0.hex
uses: ./.github/actions/build_and_upload
with:
sample-dir: code/nrf-connect/samples/ble
board: bparasite_nrf52833
revision: '2.0.0'
cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_SEC=1
output-bin: ble_test_nrf52833_bthomev2_1s_v2.0.0.hex
- name: Build ble_nrf52833_default.hex
uses: ./.github/actions/build_and_upload
with:
sample-dir: code/nrf-connect/samples/ble
board: bparasite_nrf52833
output-bin: ble_nrf52833_default.hex
- name: Build zigbee_nrf52840_default.hex
uses: ./.github/actions/build_and_upload uses: ./.github/actions/build_and_upload
with: with:
sample-dir: code/nrf-connect/samples/zigbee sample-dir: code/nrf-connect/samples/zigbee
board: bparasite_nrf52840 board: bparasite_${{ matrix.soc }}
output-bin: zigbee_nrf52840_default.hex revision: ${{ matrix.revision }}
cmake-extra: -DPRST_ZB_BUILD_DATE=__TODAY__ cmake-extra: -DCONFIG_PRSTLIB_LOG_LEVEL_DEBUG=y
output-bin: zigbee_${{ matrix.soc }}_${{ matrix.version }}_debug.hex