diff --git a/.github/workflows/build-inputs.yml b/.github/workflows/build-inputs.yml index c602266..892f6fa 100644 --- a/.github/workflows/build-inputs.yml +++ b/.github/workflows/build-inputs.yml @@ -5,11 +5,10 @@ on: board: description: 'Board' required: true - default: 'nice_nano' shield: description: 'Shield' required: false - default: 'corne_left' + default: '' alphas: description: 'Miryoku Alphas' required: false diff --git a/.github/workflows/build-matrix.yml b/.github/workflows/build-matrix.yml index 007cd3f..965fb01 100644 --- a/.github/workflows/build-matrix.yml +++ b/.github/workflows/build-matrix.yml @@ -14,8 +14,8 @@ jobs: # - absolem # out # - bastyl_left # out # - bastyl_right # out - # - corne_left # in - # - corne_right # in + - corne_left # in + - corne_right # in # - cradio36_left # TODO # - cradio36_right # TODO # - cradio_left # in @@ -47,14 +47,15 @@ jobs: # - splitreus62_left # in # - splitreus62_right # in # without shield: - - "" + # - "" board: # with shield: - # - bluemicro840 - # - nice_nano - # - nice_nano_v2 - # - nrfmicro - # - proton_c + # - bluemicro840_v1 # in + - nice_nano # in + # - nice_nano_v2 # in + # - nrfmicro_11 # in + # - nrfmicro_13 # in + # - proton_c # in # without shield: # - ahokore # out # - corne-ish_zen_left # TODO @@ -62,7 +63,7 @@ jobs: # - ferris_rev02_left # WIP # - ferris_rev02_right # WIP # - planck_rev6 # in - - zaphod # out + # - zaphod # out alphas: - "" # - colemak @@ -74,7 +75,7 @@ jobs: nav: - "" # - vi - # - invertedt + # - invertedt # TODO clipboard: - "" # - fun @@ -82,7 +83,7 @@ jobs: # - win layers: - "" - # - flip + # - flip # TODO mapping: - "" steps: diff --git a/.github/workflows/test-boards.yml b/.github/workflows/test-boards.yml index 91ed571..747e6a9 100644 --- a/.github/workflows/test-boards.yml +++ b/.github/workflows/test-boards.yml @@ -10,52 +10,8 @@ jobs: fail-fast: false matrix: shield: -# with shield: - # - absolem # out - # - bastyl_left # out - # - bastyl_right # out - # - corne_left # in - # - corne_right # in - # - cradio36_left # TODO - # - cradio36_right # TODO - # - cradio_left # in - # - cradio_right # in - # - cradios_left # TODO - # - cradios_right # TODO - # - cradioz_left # TODO - # - cradioz_right # TODO - # - crbn # in - # - eek # in - # - helix_left # in - # - helix_right # in - # - iris_left # in - # - iris_right # in - # - jian_left # in - # - jian_right # in - # - jorne_left # in - # - jorne_right # in - # - kyria_left # in - # - kyria_right # in - # - lily58_left # in - # - lily58_right # in - # - microdox_left # in - # - microdox_right # in - # - pteron36_left # out - # - pteron36_right # out - # - sofle_left # in - # - sofle_right # in - # - splitreus62_left # in - # - splitreus62_right # in -# without shield: - "" board: -# with shield: - # - bluemicro840 - # - nice_nano - # - nice_nano_v2 - # - nrfmicro - # - proton_c -# without shield: - ahokore # out # - corne-ish_zen_left # TODO # - corne-ish_zen_right # TODO @@ -65,24 +21,12 @@ jobs: - zaphod # out alphas: - "" - # - colemak - # - colemakdhk - # - dvorak - # - halmak - # - workman - # - qwerty nav: - "" - # - vi - # - invertedt clipboard: - "" - # - fun - # - mac - # - win layers: - "" - # - flip mapping: - "" steps: diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index ec0cf6c..e77b763 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -15,79 +15,17 @@ jobs: fail-fast: false matrix: shield: -# with shield: - # - absolem # out - # - bastyl_left # out - # - bastyl_right # out - corne_left # in - # - corne_right # in - # - cradio36_left # TODO - # - cradio36_right # TODO - # - cradio_left # in - # - cradio_right # in - # - cradios_left # TODO - # - cradios_right # TODO - # - cradioz_left # TODO - # - cradioz_right # TODO - # - crbn # in - # - eek # in - # - helix_left # in - # - helix_right # in - # - iris_left # in - # - iris_right # in - # - jian_left # in - # - jian_right # in - # - jorne_left # in - # - jorne_right # in - # - kyria_left # in - # - kyria_right # in - # - lily58_left # in - # - lily58_right # in - # - microdox_left # in - # - microdox_right # in - # - pteron36_left # out - # - pteron36_right # out - # - sofle_left # in - # - sofle_right # in - # - splitreus62_left # in - # - splitreus62_right # in -# without shield: - # - "" board: -# with shield: - # - bluemicro840 - nice_nano - # - nice_nano_v2 - # - nrfmicro - # - proton_c -# without shield: - # - ahokore # out - # - corne-ish_zen_left # TODO - # - corne-ish_zen_right # TODO - # - ferris_rev02_left # WIP - # - ferris_rev02_right # WIP - # - planck_rev6 # in - # - zaphod # out alphas: - "" - # - colemak - # - colemakdhk - # - dvorak - # - halmak - # - workman - # - qwerty nav: - "" - # - vi - # - invertedt clipboard: - "" - # - fun - # - mac - # - win layers: - "" - # - flip mapping: - "" steps: diff --git a/.github/workflows/test-configs.yml b/.github/workflows/test-configs.yml index b613d21..538ee9f 100644 --- a/.github/workflows/test-configs.yml +++ b/.github/workflows/test-configs.yml @@ -10,59 +10,9 @@ jobs: fail-fast: false matrix: shield: -# with shield: - # - absolem # out - # - bastyl_left # out - # - bastyl_right # out - corne_left # in - # - corne_right # in - # - cradio36_left # TODO - # - cradio36_right # TODO - # - cradio_left # in - # - cradio_right # in - # - cradios_left # TODO - # - cradios_right # TODO - # - cradioz_left # TODO - # - cradioz_right # TODO - # - crbn # in - # - eek # in - # - helix_left # in - # - helix_right # in - # - iris_left # in - # - iris_right # in - # - jian_left # in - # - jian_right # in - # - jorne_left # in - # - jorne_right # in - # - kyria_left # in - # - kyria_right # in - # - lily58_left # in - # - lily58_right # in - # - microdox_left # in - # - microdox_right # in - # - pteron36_left # out - # - pteron36_right # out - # - sofle_left # in - # - sofle_right # in - # - splitreus62_left # in - # - splitreus62_right # in -# without shield: - # - "" board: -# with shield: - # - bluemicro840 - nice_nano - # - nice_nano_v2 - # - nrfmicro - # - proton_c -# without shield: - # - ahokore # out - # - corne-ish_zen_left # TODO - # - corne-ish_zen_right # TODO - # - ferris_rev02_left # WIP - # - ferris_rev02_right # WIP - # - planck_rev6 # in - # - zaphod # out alphas: - "" - colemak @@ -74,7 +24,7 @@ jobs: nav: - "" - vi - - invertedt + # - invertedt # TODO clipboard: - "" - fun @@ -82,7 +32,7 @@ jobs: - win layers: - "" - # - flip + # - flip # TODO mapping: - "" steps: diff --git a/.github/workflows/test-controllers.yml b/.github/workflows/test-controllers.yml new file mode 100644 index 0000000..6ce1270 --- /dev/null +++ b/.github/workflows/test-controllers.yml @@ -0,0 +1,149 @@ +name: 'Test Controllers' +on: + - workflow_dispatch +jobs: + build: + runs-on: ubuntu-latest + container: + image: zmkfirmware/zmk-build-arm:2.5 + strategy: + fail-fast: false + matrix: + shield: + - corne_left # in + board: + - bluemicro840_v1 # in + - nice_nano # in + - nice_nano_v2 # in + - nrfmicro_11 # in + - nrfmicro_13 # in + - proton_c # in + alphas: + - "" + nav: + - "" + clipboard: + - "" + layers: + - "" + mapping: + - "" + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Process inputs + id: inputs + run: | + echo "::set-output name=board::${{ matrix.board }}" + echo "::set-output name=shield::${{ matrix.shield }}" + echo "::set-output name=alphas::${{ matrix.alphas }}" + echo "::set-output name=nav::${{ matrix.nav }}" + echo "::set-output name=clipboard::${{ matrix.clipboard }}" + echo "::set-output name=layers::${{ matrix.layers }}" + echo "::set-output name=mapping::${{ matrix.mapping }}" + - name: Process variables + id: variables + run: | + keyboard=${{ steps.inputs.outputs.board }} + if [ -n "${{ steps.inputs.outputs.shield }}" ] + then + SHIELD_ARG="-DSHIELD=${{ steps.inputs.outputs.shield }}" + keyboard=${{ steps.inputs.outputs.shield }} + fi + echo "::set-output name=shield-arg::${SHIELD_ARG}" + keyboard=`echo "$keyboard" | sed 's/_\(left\|right\)//'` + + configfile="${GITHUB_WORKSPACE}/miryoku/config.h" + echo '// https://github.com/manna-harbour/miryoku-zmk/' > "$configfile" + echo "::set-output name=configfile::$configfile" + + artifact_build_name="miryoku_zmk ${{ steps.inputs.outputs.shield }} ${{ steps.inputs.outputs.board }}" + for option in "alphas_${{ steps.inputs.outputs.alphas }}" "nav_${{ steps.inputs.outputs.nav }}" "clipboard_${{ steps.inputs.outputs.clipboard }}" "layers_${{ steps.inputs.outputs.layers }}" "mapping_${{ steps.inputs.outputs.mapping }}" + do + case "$option" in + *_ ) ;; + * ) + artifact_build_name="$artifact_build_name $option" + echo "#define MIRYOKU_"`echo "$option" | tr 'a-z' 'A-Z'` >> "$configfile" + ;; + esac + done + artifact_build_name=`echo $artifact_build_name | 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=artifact-dir::artifacts" + + manifests="manifests" + manifest="$manifests/west-$keyboard.yml" + if [ ! -f "config/$manifest" ] + then + manifest="west.yml" + fi + echo "::set-output name=manifest::$manifest" + + echo "::set-output name=board-config::board-config" + + env_file="config/board-configs/$keyboard.env" + if [ -f "$env_file" ] + then + cat "$env_file" >> $GITHUB_ENV + echo "::set-output name=has_board_config::true" + fi + - name: Checkout board-config + if: ${{ steps.variables.outputs.has_board_config == 'true' }} + uses: actions/checkout@v2 + with: + repository: ${{ env.board_config_repository }} + ref: ${{ env.board_config_ref }} + path: ${{ steps.variables.outputs.board-config }} + - name: Use board-config + if: ${{ steps.variables.outputs.has_board_config == 'true' }} + run: | + mkdir -p `dirname "config/${{ env.board_config_to }}"` + ln -sr ${{ steps.variables.outputs.board-config }}/${{ env.board_config_from }} config/${{ env.board_config_to }} + if [ -n "${{ env.board_config_manifestdir }}" ] + then + cp ${{ steps.variables.outputs.board-config }}/${{ env.board_config_manifestdir }}/west.yml config/ + cat config/west.yml + fi + - name: Cache west modules + uses: actions/cache@v2 + env: + cache-name: zephyr + with: + path: | + bootloader/ + modules/ + tools/ + zephyr/ + zmk/ + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles(format('config/{0}', steps.variables.outputs.manifest)) }} + restore-keys: ${{ runner.os }}-${{ env.cache-name }} + timeout-minutes: 2 + continue-on-error: true + - name: Initialize workspace (west init) + run: west init -l config --mf ${{ steps.variables.outputs.manifest }} + - name: Update modules (west update) + run: west update + - name: Export Zephyr CMake package (west zephyr-export) + run: west zephyr-export + - name: Build (west build) + run: west build -s zmk/app -b ${{ steps.inputs.outputs.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" + - name: Prepare artifacts + run: | + mkdir ${{ steps.variables.outputs.artifact-dir }} + cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" + for extension in "hex" "uf2" + do + file="build/zephyr/zmk.$extension" + if [ -f "$file" ] + then + cp "$file" "${{ steps.variables.outputs.artifact-dir }}/${{ 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.artifact-dir }} + continue-on-error: true diff --git a/.github/workflows/test-shields.yml b/.github/workflows/test-shields.yml index af750ff..17d4dca 100644 --- a/.github/workflows/test-shields.yml +++ b/.github/workflows/test-shields.yml @@ -10,7 +10,6 @@ jobs: fail-fast: false matrix: shield: -# with shield: - absolem # out - bastyl_left # out - bastyl_right # out @@ -46,43 +45,16 @@ jobs: - sofle_right # in - splitreus62_left # in - splitreus62_right # in -# without shield: - # - "" board: -# with shield: - # - bluemicro840 - nice_nano - # - nice_nano_v2 - # - nrfmicro - # - proton_c -# without shield: - # - ahokore # out - # - corne-ish_zen_left # TODO - # - corne-ish_zen_right # TODO - # - ferris_rev02_left # WIP - # - ferris_rev02_right # WIP - # - planck_rev6 # in - # - zaphod # out alphas: - "" - # - colemak - # - colemakdhk - # - dvorak - # - halmak - # - workman - # - qwerty nav: - "" - # - vi - # - invertedt clipboard: - "" - # - fun - # - mac - # - win layers: - "" - # - flip mapping: - "" steps: diff --git a/readme.org b/readme.org index 5b4183a..afa2be1 100644 --- a/readme.org +++ b/readme.org @@ -29,6 +29,10 @@ Any [[https://github.com/zmkfirmware/zmk/tree/main/app/boards/arm][board support Any compatible combination of [[https://github.com/zmkfirmware/zmk/tree/main/app/boards/arm][board supported by ZMK]] and [[https://github.com/zmkfirmware/zmk/tree/main/app/boards/shields][shield supported by ZMK]] with a [[#keyboard-keymaps][keymap in Miryoku ZMK]]. +*** Out of Tree Boards and Shields + +Additionally, some out of tree boards and shields are automatically supported by the included GitHub Actions workflows. See [[./config/board-configs/]]. + ** Local Builds @@ -37,7 +41,6 @@ Clone this repo and use for [[https://zmk.dev/docs/development/build-flash#build ** GitHub Actions Workflows -Some out of tree boards and shields are automatically supported in the included workflows. See [[./config/board-configs/]]. *** Prebuilt Firmware @@ -49,9 +52,9 @@ Some prebuilt firmware can be downloaded from the repo. Log in to GitHub, visit Fork this repo, select the [[https://github.com/manna-harbour/zmk-config/actions/workflows/build-inputs.yml][Build Inputs]] workflow action, select Run workflow, fill out the form with a [[#Supported-Keyboards][supported keyboard]] and [[#configuration-options][configuration options]], activate Run workflow, wait for successful completion, select the workflow run, select the Artifacts, and unzip the downloaded zip file. -*** Customise Workflow Files +*** Build Matrix -Fork this repo, copy, and edit the included [[https://github.com/manna-harbour/zmk-config/actions/workflows/build-matrix.yml][Build Matrix]] workflow files with [[#Supported-Keyboards][supported keyboards]] and [[#configuration-options][configuration options]]. +Fork this repo, copy, rename, and edit the included [[https://github.com/manna-harbour/zmk-config/actions/workflows/build-matrix.yml][Build Matrix workflow]] by commenting and uncommenting the included matrix elements for [[#Supported-Keyboards][supported keyboards]] and [[#configuration-options][configuration options]]. Enable elements from only one of the with shield or without shield sections per file. * Miryoku Keymap @@ -75,7 +78,6 @@ Convert to the form ~#define option_value~. To apply the configuration options ** Configuration Options in GitHub Actions Workflows - Convert to the form ~value~ (uppercase or lowercase) and use with the corresponding ~option~ [[#Customise-Workflow-Files][matrix variable]] or [[#Inputs][input]]. Empty fields will use the default value. @@ -145,6 +147,7 @@ compatibility [[https://raw.githubusercontent.com/manna-harbour/miryoku/master/kle-miryoku-mapping-ortho_4x12.png]] + **** Extended Thumbs @@ -185,6 +188,7 @@ compatibility Keymap files for many keyboards included in ZMK are provided in [[./config/][config/]]. + * Contact For feature requests or issues with code or documentation please