mirror of
https://github.com/ClaytonWWilson/miryoku_zmk.git
synced 2025-12-13 17:58:47 +00:00
149 lines
3.9 KiB
YAML
149 lines
3.9 KiB
YAML
name: Build
|
|
on:
|
|
- push
|
|
- pull_request
|
|
- workflow_dispatch
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: zmkfirmware/zmk-build-arm:2.4
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shield:
|
|
|
|
# - bfo9000_left
|
|
# - bfo9000_right
|
|
|
|
- corne_left
|
|
- corne_right
|
|
|
|
- cradio_left
|
|
- cradio_right
|
|
|
|
# - cradio36_left
|
|
# - cradio36_right
|
|
|
|
# - cradios_left
|
|
# - cradios_right
|
|
|
|
# - cradioz_left
|
|
# - cradioz_right
|
|
|
|
- crbn
|
|
|
|
- eek
|
|
|
|
- helix_left
|
|
- helix_right
|
|
|
|
- iris_left
|
|
- iris_right
|
|
|
|
- jian_left
|
|
- jian_right
|
|
|
|
- jorne_left
|
|
- jorne_right
|
|
|
|
- kyria_left
|
|
- kyria_right
|
|
|
|
- lily58_left
|
|
- lily58_right
|
|
|
|
- microdox_left
|
|
- microdox_right
|
|
|
|
- sofle_left
|
|
- sofle_right
|
|
|
|
- splitreus62_left
|
|
- splitreus62_right
|
|
|
|
board:
|
|
- nice_nano
|
|
config:
|
|
- ""
|
|
|
|
include:
|
|
|
|
# - shield: absolem
|
|
# board:
|
|
|
|
# - board: ahokore
|
|
|
|
# - board: ferris
|
|
|
|
- board: planck_rev6
|
|
|
|
- shield: corne_left
|
|
board: nice_nano
|
|
config: clipboard_mac
|
|
|
|
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('config/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 config
|
|
- 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 }}"
|
|
fi
|
|
echo "::set-output name=shield-arg::${SHIELD_ARG}"
|
|
artifact_build_name=`echo miryoku-zmk ${{ matrix.shield }} ${{ matrix.board }} ${{ matrix.config }} | tr ' ' '-'`
|
|
echo "::set-output name=artifact-build-name::$artifact_build_name"
|
|
echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'`
|
|
echo "::set-output name=tmpdir::artifacts"
|
|
- name: Copy config file
|
|
run: |
|
|
if [ -n "${{ matrix.config }}" ]; then
|
|
cp "${GITHUB_WORKSPACE}/miryoku/configs/${{ matrix.config }}.h" "${GITHUB_WORKSPACE}/miryoku/config.h"
|
|
fi
|
|
- name: Build (west build)
|
|
run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
|
- name: Prepare artifacts
|
|
run: |
|
|
mkdir ${{ steps.variables.outputs.tmpdir }}
|
|
cp "${GITHUB_WORKSPACE}/miryoku/config.h" ${{ steps.variables.outputs.tmpdir }}
|
|
for extension in "hex" "uf2"
|
|
do
|
|
file="build/zephyr/zmk.$extension"
|
|
if [ -f "$file" ]
|
|
then
|
|
cp "$file" "${{ steps.variables.outputs.tmpdir }}/${{ steps.variables.outputs.artifact-build-name }}.$extension"
|
|
fi
|
|
done
|
|
- name: Archive artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ steps.variables.outputs.artifact-generic-name }}
|
|
path: ${{ steps.variables.outputs.tmpdir }}
|
|
continue-on-error: true
|