rework
This commit is contained in:
parent
0c28a3586a
commit
f59457cf87
20 changed files with 409 additions and 39 deletions
68
.github/workflows/build.yml
vendored
68
.github/workflows/build.yml
vendored
|
|
@ -3,12 +3,47 @@ on: [pull_request, workflow_dispatch]
|
|||
name: Build
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
name: Fetch Build Keyboards
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install yaml2json
|
||||
run: python3 -m pip install remarshal
|
||||
- id: set-matrix
|
||||
name: Fetch Build Matrix
|
||||
run: |
|
||||
matrix=$(yaml2json build.yaml | jq -c .)
|
||||
yaml2json build.yaml
|
||||
echo "::set-output name=matrix::${matrix}"
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: zmkfirmware/zmk-build-arm:2.4
|
||||
image: petejohanson/zmk-build-arm:3.0-branch
|
||||
needs: matrix
|
||||
name: Build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
|
||||
steps:
|
||||
- name: Prepare variables
|
||||
id: variables
|
||||
run: |
|
||||
if [ -n "${{ matrix.shield }}" ]; then
|
||||
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
|
||||
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
|
||||
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
|
||||
else
|
||||
EXTRA_CMAKE_ARGS=
|
||||
DISPLAY_NAME="${{ matrix.board }}"
|
||||
ARTIFACT_NAME="${{ matrix.board }}-zmk"
|
||||
fi
|
||||
echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
|
||||
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
|
||||
echo ::set-output name=display-name::${DISPLAY_NAME}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache west modules
|
||||
|
|
@ -33,19 +68,28 @@ jobs:
|
|||
run: west update
|
||||
- name: West Zephyr export
|
||||
run: west zephyr-export
|
||||
- name: West Build (Hummingbird)
|
||||
run: west build -s zmk/app -b seeeduino_xiao -- -DSHIELD=hummingbird -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
||||
- name: UF2 Build
|
||||
run: python3 ./tools/uf2/utils/uf2conv.py -c -f SAMD21 -o build/zephyr/zmk.uf2 build/zephyr/zmk.bin
|
||||
- name: Hummingbird DTS File
|
||||
- name: West Build (${{ steps.variables.outputs.display-name }})
|
||||
run: |
|
||||
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
|
||||
- name: ${{ steps.variables.outputs.display-name }} DTS File
|
||||
if: ${{ always() }}
|
||||
run: cat -n build/zephyr/seeeduino_xiao.dts.pre.tmp
|
||||
- name: Hummingbird Kconfig file
|
||||
run: |
|
||||
if [ -f "build/zephyr/${{ matrix.board }}.dts.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp; fi
|
||||
if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
|
||||
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
|
||||
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
|
||||
- name: Rename zmk.uf2
|
||||
run: cp build/zephyr/zmk.uf2 hummingbird.uf2
|
||||
- name: Archive (Hummingbird)
|
||||
- name: Rename artifacts
|
||||
run: |
|
||||
mkdir build/artifacts
|
||||
if [ -f build/zephyr/zmk.uf2 ]
|
||||
then
|
||||
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
|
||||
elif [ -f build/zephyr/zmk.hex ]
|
||||
then
|
||||
cp build/zephyr/zmk.hex "build/artifacts/${{ steps.variables.outputs.artifact-name }}.hex"
|
||||
fi
|
||||
- name: Archive (${{ steps.variables.outputs.display-name }})
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: firmware
|
||||
path: hummingbird.uf2
|
||||
path: build/artifacts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue