Merge pull request #6 from MangoIV/mangoiv/newer-kernel #61
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: Build | |
env: | |
config-path: zmk-config | |
on: | |
push: | |
paths: | |
- ".github/workflows/build.yml" | |
- "zmk-config/**" | |
pull_request: | |
paths: | |
- ".github/workflows/build.yml" | |
- "zmk-config/**" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
container: | |
image: zmkfirmware/zmk-build-arm:3.5-branch-20231114235846-3.5.0-0.16.3-6c450465d1dd-6870957618 | |
strategy: | |
fail-fast: false | |
matrix: | |
# List the firmware to build here. Each item use the following properties. | |
# board: (required) the board to build. | |
# shield: (optional) the shield to build. Omit for a standalone board. | |
# cmake-args: (optional) extra arguments to pass to CMake as a string. | |
include: | |
- board: le_chiff_ble | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache west modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-zephyr-modules | |
with: | |
path: | | |
bootloader/ | |
modules/ | |
tools/ | |
zephyr/ | |
zmk/ | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('${{ env.config-path }}/west.yml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
timeout-minutes: 2 | |
continue-on-error: true | |
- name: Initialize workspace (west init) | |
run: west init -l ${{ env.config-path }} | |
- name: Update modules (west update) | |
run: west update | |
- name: Export Zephyr CMake package (west zephyr-export) | |
run: west zephyr-export | |
- name: Prepare variables | |
id: variables | |
run: | | |
if [ -n "${{ matrix.shield }}" ]; then | |
SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" | |
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk" | |
else | |
SHIELD_ARG= | |
ARTIFACT_NAME="${{ matrix.board }}-zmk" | |
fi | |
echo ::set-output name=shield-arg::${SHIELD_ARG} | |
echo ::set-output name=artifact-name::${ARTIFACT_NAME} | |
- name: Build (west build) | |
run: | | |
west build -s zmk/app -b ${{ matrix.board }} -- \ | |
${{ steps.variables.outputs.shield-arg }} \ | |
-DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ env.config-path }}" \ | |
${{ matrix.cmake-args }} | |
# - name: Generated DTS file | |
# if: always() | |
# run: cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp | |
- name: Rename artifacts | |
run: | | |
mkdir build/artifacts | |
[ -f build/zephyr/zmk.hex ] && cp build/zephyr/zmk.hex "build/artifacts/${{ steps.variables.outputs.artifact-name }}.hex" | |
[ -f build/zephyr/zmk.uf2 ] && cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2" | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "${{ steps.variables.outputs.artifact-name }}" | |
path: build/artifacts |